problemset_sol1 - CS211 Homework Problem Set 1 SOLUTIONS Assumptions For all of these problems you may assume the following sizeof(int = 4 sizeof(short

problemset_sol1 - CS211 Homework Problem Set 1 SOLUTIONS...

This preview shows page 1 - 2 out of 4 pages.

CS211: Homework Problem Set 1 SOLUTIONS Question 1:Given the following declarations:char c = ’A’;char * p = &c;char ** p2 = &p;void * v = &p2;Examine each of the following expressions. If the expression is illegal, write ILLEGAL. If the expression is legal, write its type (i.e. int ** or unsigned long\ etc): Question 2:There is an old C programmer’s joke which goes as follows:Two strings walk into a bar. The first one says“Hi I’d like a beer.A2%asd$ASDlk2;3423Ammm.234ASDfmmlASDFLJ:#@$”The second says“You’ll have to pardon my friend, he’s not null terminated.”Explain the joke.
Image of page 1

Want to read all 4 pages?

Image of page 2

Want to read all 4 pages?

You've reached the end of your free preview.

Want to read all 4 pages?

  • Fall '08
  • Staff
  • ASCII, null character, following code, int ** p2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture