Introduction to Programming and C++

Contents Previous Topic Next Topic

A quick comment on comments. Some older compilers do not recognize the // comment. The compiler you will use on ecelinux does, as does the compiler which ships with Dev C++, however, this is worth mentioning just in case you end up working with an older compiler.

The only form of comments in the original C programming language were of the form /* this is a comment */.


Questions

1. What is the output of the following (oddly-commented) printf statement, assuming the compiler does not recognize // comments?

	printf( "%d / %d = %d\n", 8, 4, 8//* dumb-dee-dah */4 );

2. What happens in Question 1 if you compile it using gcc?


Contents Previous Topic Top Next Topic