Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

const char * to int? 1

Status
Not open for further replies.

Bigbass

Programmer
Joined
Feb 13, 2006
Messages
6
I'm using vs2003 C++ and I need to convert the following line to an integer:

unsigned char *computeMe(unsigned char *SNumbers, unsigned char *SMoreNumbers);

Any help would be great!
 
Use a stringstream:
Code:
#include <sstream>

int main()
{
   char strNum[] = "666";
   int  num = 0;
   std::stringstream str;
   str << strNum;
   str >> num;

   return num;
}
 
did the job! Thanks!
 
Don't post the same question in multiple forums.

Lee
 
Sorry about that, my mistake. The title for this question is similar to one person who asked the same thing in 2 other forums at the same time.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top