Quote:
Originally Posted by JosAH
That is a compilation error; most likely you're missing a right curly brace near
the end of your code. Check them carefully and you'll find the missing one.
The atoi() function takes a '\0' terminated string and returns the int represented
by that string; it shouldn't be a problem if your array contains just digits.
kind regards,
Jos
Yes, it my code was missing closing curly braces of main() function.
The problem I had was parseing error which after fixing the code is:
string.c: In function `main':
string.c:22: error: parse error before '{' token
string.c: At top level:
string.c:26: error: parse error before '}' token
My array is meant to take numbers and dashes "-" which is why I am checking (or rather trying to) each element of the array and sort it into another array of type int (called numericisbn).
The article is about ISBN of books. As you know it comes with dashes alongside numbers, I am basically trying to filterout the dashes.
Regards.
Alien.