GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Aug-2008, 20:57
helpmeplz helpmeplz is offline
New Member
 
Join Date: Jul 2008
Posts: 22
helpmeplz is an unknown quantity at this point
Question

Binary converter


I havent started writing it yet but just need to know how i can find the place of a 1 or 0 in a string (like the 5th number is a 0) and go from there on.

i tryed to google it but that didnt work
  #2  
Old 03-Aug-2008, 21:17
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: binary converter


Quote:
Originally Posted by helpmeplz
...how i can find the place of a 1 or 0 in a string (like the 5th number is a 0) and go from there on.
Bit-wise or character-wise?
  #3  
Old 03-Aug-2008, 21:46
helpmeplz helpmeplz is offline
New Member
 
Join Date: Jul 2008
Posts: 22
helpmeplz is an unknown quantity at this point

Re: binary converter


charcter-wise
  #4  
Old 03-Aug-2008, 22:01
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 580
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: binary converter


Quote:
Originally Posted by helpmeplz
charcter-wise
If you are using the C++ string class, consider the find() method as described at the following:

http://www.cplusplus.com/reference/s...ring/find.html

If you are using C-style null-terminated strings, consider the strchr() standard call:

http://www.cplusplus.com/reference/c...ng/strchr.html

Otherwise by brute force, iterate through each character of the string, & compare it to whatever you want.
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New to programming (Homework Help) fishguts Miscellaneous Programming Forum 1 12-Sep-2007 11:50
Binary to Decimal Conversion Saberwing C Programming Language 5 28-Dec-2006 15:57
help with 16-bit binary nos phil1234 C Programming Language 1 02-Mar-2006 13:06
copying a portion of Binary file into another Binary file vishi C Programming Language 5 25-Jul-2005 09:05
Binary Tree Trouble neufunk C Programming Language 4 06-Dec-2004 10:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:57.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.