How Do You Troubleshoot the C Program Error “error: expected ‘;’ before string constant”?

Problem scenario
You try to compile a program with "gcc".  You get this output: " expected ';' before string constant"

What do you do to compile your program?

Go to line 55 of  If there is a printf command, be sure that the thing to be printed is surrounded by parentheses.  Here is an example of a line that will cause the problem:
   printf "This is a test";

Here is an example of a printf command with proper syntax:
   printf ("This is a test");

Leave a comment

Your email address will not be published. Required fields are marked *