Jump to content
  • 0

related to ' c ' language


Arjun

Question

hello guys,

actually i want to assign char array value to int variable ,,,

just like  i want ..

char myarray[4] = {'0','x','2','3'};

int i = atoi(myarray);

printf("%d\n", i);

 it is printing 0,,,

-----------------------------------------

but if i use value

char myarray[4] = {'0','2','2','3'};

int i = atoi(myarray);

printf("%d\n", i);

 then it is working ....

can you guys please help me out from this problem .....

Thank-you

Regards

Arjun

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...