I've gotten to the point where I've run out of ideas for simple programs to write.
I've done things like counting the numbers of even/odd numbers that have been entered:
void sort( int argc, char *argv[] ) {
int numTrack = 1;
int oddTrack = 0;
int evenTrack = 0;
while( numTrack < argc ) {
char *p = argv[numTrack];
if( p[strlen(p) - 1]%2 == 0 ) {
evenTrack++;
} else {
oddTrack++;
}
numTrack++;
}
printf( "\n" );
printf( "Odd: %d\n", oddTrack );
printf( "Even: %d\n", evenTrack );
printf( "\n" );
}
main( int argc, char *argv[] ) {
sort( argc, argv );
}
That snippet of code basically encompasses my knowledge of C thus far.
So, any ideas, even one, would help a lot!
Thanks in advance, Takuya.

New Topic/Question
This topic is locked



MultiQuote







|