•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 456,563 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,515 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 2858 | Replies: 13 | Solved
![]() |
•
•
•
•
Never define main as void return. Start defining main as int main( void ) or int main ( int argc, char *argv[] ) if you are expecting arguments from the command line.
>Sorry i never learn about <ctype.h>, isalpha, islower and isupper, is there other way???
C Syntax (Toggle Plain Text)
#include <stdio.h> /* #define ALL_CHARACTER */ /* enable for use all characters in RANGE */ /* #define RANGE */ /* enable for only lower case */ #ifdef RANGE #define START 'a' #endif #ifndef RANGE #define START 'A' #endif int main( void ) { char character[256] = { 0 }; int c = '\0'; puts( "Enter some text:" ); while ( ( c = getchar() ) != '\n' && c != EOF ) { ++character[c]; } for ( c = START; c <= 'z'; c++ ) { #ifndef ALL_CHARACTER if ( character[c] ) #endif printf( "%c = %d\n", c, character[c] ); } getchar(); return 0; }
Aiks, i really fresh in C. Your coding contain some element i never learn before. haha
But thx, i copy paste the code and run it, it work perfectly.
•
•
•
•
Aiks, i really fresh in C. Your coding contain some element i never learn before.
No copy and paste. Write it. Practice. Write it again. Practice again.
You'll learn nothing by just coping and paste and looking at it, and rejoicing that it works.
You don't know that it works until you understand why it does.
That's not C. Don't pay attention to it.
At the very moment that I find myself in the side of the mayority, I will know that I need to re-think my ideas. ~ In my book.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Program- calculate # of days between two days (C++)
- java program to calculate simple interest (Java)
- Using Loops to calculate totals in C Program (C)
- Can anyone suggest why this program doesn't calculate correctly? (Java)
- Need help with C program (C)
- sentence capitalizer (C++)
Other Threads in the C Forum
- Previous Thread: c Compiler (Not C++)
- Next Thread: binary


haha

Linear Mode