Ex7 error ')' expected before 'char'


#1

I typed and double checked everything, but I still get this error on “make”:

ex7.c:3:19: error: expected ‘)’ before ‘char’
int main(intargc, char*argv[])

I can’t figure out what I did wrong. I even copy and pasted everything in the ebook and I still get the error. Does anyone have any idea what I’m doing wrong?


#2

Take a look at how you have intargc but I have int argc. See the space in mine? You have to be concious of the spacing, and adding more spacing is better than removing it. Trying to type code like:

int x=y+j/34*(hg^l);

Leads to errors like what you have here. Add in some spacing and it’s easier to read it and see errors:

int x = y + j / 34 * ( hg ^ l );

#3

I’m sorry… I can’t believe I missed that… I think I need to practice reading again. Apparently I’ve forgotten how to ‘read it backwards’ like when I worked through the LPTHW book.

Thank you!


#4

Don’t feel bad. Once character mistakes are soooooooo common in programming it’s almost a disease. I have no idea why, but you can have really huge mistakes everyone see instantly, but get one character wrong and people will miss it for weeks.


#5

It migt be becuse we reed wards as a wole.