|
||||||
| 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 01: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 04:13 PM |
| function pointer | Chinmoy | C Tutorials | 0 | 03-19-2008 01:52 AM |
| SecurityAudit | vinay | Visual Basic Programming | 27 | 01-07-2008 01:14 PM |
| multi-pass preprocessing | kenna | C and C++ | 11 | 08-14-2007 11:45 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |