error: undeclared (need some help)

This is a discussion on error: undeclared (need some help) within the C++ Programming forums, part of the General Programming Boards category; It does. It is supposed to compute the value and return it. That implies that you do not need a ...

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,431
    It does. It is supposed to compute the value and return it.
    That implies that you do not need a yIntercept member variable unless you intend to perform caching of the value, but that does not seem to be the case here.

    With the way it was set up the instructor was initializing those variables locally (yIntercept and slope) so I only put them in the .h file after it was giving me an error message (the one I had earlier).
    I suggest that you revert to the header file that your instructor provided.

    Either way I got rid of the initialization in the local part of the program and it didn't change anything.
    What do you mean by "got rid of the initialization in the local part of the program"? There is no such thing as "the local part of the program", since locality depends on your point of reference.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    Registered User
    Join Date
    Feb 2008
    Posts
    9
    I just reverted to the old header file, and decided to take a screenshot to possibly clear it up:

    http://img90.imageshack.us/img90/9528/lab2imageja3.png

    Hopefully this helps.

    And sorry, when I said locally I meant in relation to what i was working on (the yIntercept part).

  3. #18
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,431
    I just reverted to the old header file, and decided to take a screenshot to possibly clear it up:
    That's your source file for the Segment class implementation, not the "Segment.h" header.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21