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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with atoi in vs.net

Status
Not open for further replies.

piofenton

Instructor
Jul 12, 2002
33
IE
I get an error every time I run the following code : along the lines of :error C2440: '=' : cannot convert from 'std::basic_istream<_Elem,_Traits>::int_type' to 'char *'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]

//my code begins here
char* num;
for(int i=0; i < child.length(); i++ ) {

num = seeds.get();
int x = atoi(num);
child.gene(i,i);
cout<<child.gene(i);
seeds.get();
}

Can anybody see the problem
 
Hi!

I do not know what are u doing at your code ( I dont think it is important at this moment)
but look at piece of my code

char* variable;
variable = "22";
int i = 0;
i = atoi(variable);

It's working at all in VC++. So I hope it will be helpfull.

Best

Bartek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top