KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I don't understand the results of the following C code. main() { char s[] = "AAA"; advanceString(s); } void advanceString(p[3]) { int val = atoi(p); printf("The atoi val is %d\n",val); } Here the atoi value is shown as 0, but I could not figure out the exact reason. As per my understanding, it should be the summation of decimal equivalent of each values in the array? Please correct me if I am wrong.
Tags (comma-separated)
Save Edits
Cancel