O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2

1: What are the basic modules of a C program called?
A1: They are called functions.
2: What is a syntax error? Give an example of one in English and one in C.
A2: A syntax error is a violation of the rules governing how sentences or programs are put together. Here's an example in English: “Me speak English good.” Here's an example in C:
printf"Where are the parentheses?";.
3: What is a semantic error? Give an example of one in English and one in C.
A3: A semantic error is one of meaning. Here's an example in English: “This sentence is excellent Italian.” Here's a C example:
thrice_n = 3 + n;
4: Indiana Sloth has prepared the following program and brought it to you for approval. Please help him out.
 include studio.h int main{void} /* ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required