|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
hello,
I am new here and I have a question about this code: " int num; char a[4]; a[0]=9; a[1]=4; a[2]=NULL; a[3]=NULL; num=atoi(grade); " I have a char array (a) that have (9 4 NULL NULL) i want to extract only the 94 using atoi function. but, when I run the program the atoi function return 0. why? thnk you, |
| Sponsored Links |
|
|
|
|||
|
Quote:
![]() Last edited by dcs; 03-26-2008 at 12:53 AM. |
|
|||||
|
'\0' and NULL have the same implication. Just that NULL works good with pointers and '\0' works good with char arrays.By eof here i wanted to mean end of input buffer..
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inline function | Chinmoy | C Tutorials | 1 | 04-07-2008 03:13 PM |
| function pointer | Chinmoy | C Tutorials | 0 | 03-19-2008 12:52 AM |
| SecurityAudit | vinay | Visual Basic Programming | 27 | 01-07-2008 12:14 PM |
| multi-pass preprocessing | kenna | C and C++ | 11 | 08-14-2007 10:45 AM |
| Xav | ........ | 1455.48 |
| MeTh0Dz|Reb0rn | ........ | 1089.45 |
| WingedPanther | ........ | 977.76 |
| marwex89 | ........ | 962.9 |
| John | ........ | 914.37 |
| morefood2001 | ........ | 911.18 |
| Brandon W | ........ | 823.79 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 276.28 |
| dcs | ........ | 253.49 |
Goal: 100,000 Posts
Complete: 84%