Menu

A little problem about an example on a book

TukangBuah
2008-08-23
2012-09-26
  • TukangBuah

    TukangBuah - 2008-08-23

    The book's called Computer Science : A Structured programming approach using C. Written by Forouzan & Richard Gilberg.

    A little problem on Chapter 9 about pointers.

    I just copy the code below from the text:

    char c;
    char* pc;

    int a;
    int* pa;

    pc = &c; // Good and valid
    pa = &a; // Good and valid

    pc = &a; // Error: different types
    pa = &a; // Error: different levels


    My question is about the last line on the code. It says error coz different levels. I'd like to know what you guys think about the last line, is it really an error? I really confused, if it is not a mistyped error from the book publisher, because I tried the code and the result is that there's no prob with the last line.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.