Hot answers tagged

2

It's always the problems that hide in plain sight that get us! ;-) isdigit() is working exactly as expected. If a character is a digit, it returns a non-zero (not necessarily 1, try printing the return value as an int) if true and returns 0 if false. There's no need to use this function in any special way as was suggested. The problem here appears to be a ...


1

It seems correct because it is. The 'expected expression' error is almost always because of misplaced, missing or extra curly braces or parentheses. Is it possible that you're editing one version of the source code and trying to make another version, or filename? Also, recommend that you run your code through style50 to clean up formatting a bit.


1

argv[] is a list of arguments introduced from the comand line. If you want to itterate through ever char in a particular argument you can do it by: argv[x][i] where x is the argument number and 'i' every character of that argument. For examble argv[1][0] would point to the first character of the second argument.


1

isalpha() takes a single character. When you try to jam a complete string down its throat, it chokes and coughs up a seg fault. You need to loop through the string and test each char individually. If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)


Only top voted, non community-wiki answers of a minimum length are eligible