Jump to content
  • Advertisement

eFoDay

Member
  • Content count

    345
  • Joined

  • Last visited

Community Reputation

300 Neutral

About eFoDay

  • Rank
    Member
  1. eFoDay

    stack comprehension question

    Found a link which may have some additional information: http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/
  2. edited post because I mainly use pointers and then I realized it doesnt work on non-pointers. this is the error you will get: In file included from main.cpp:10:0: Observer.h:16:10: error: field 'myMessage' has incomplete type [source lang="cpp"] class Message; class Observer { Message myMessage; void accessMessage(); } [/source] so actually this gives no error: [source lang="cpp"] class Message; class Observer { Message* myMessage; void accessMessage(); } [/source] this actually doesn't give an error message either: [source lang="cpp"] class Message; class Observer { Message* myMessage; void accessMessage() { myMessage->someFunc(); } } [/source] But trying to access Observer::accessMessage without including the Message header will give an error: In file included from main.cpp:10:0: Observer.h:17:49: error: invalid use of incomplete type 'class Message' Observer.h:11:7: error: forward declaration of 'class Message' [source lang="cpp"] #include "Observer.h" int main(int argc, char** argv) { Observer myObserver; myObserver.accessMessage(); // error return 0; } [/source] To fix the error you will need to include the actual header of Message so it knows about the actual functions. This is the way I usually set up my files: [source lang="cpp"] // .h file class Message; class Observer { Message* myMessage; void accessMessage(); } // .cpp file #include "observer.h" #include "message.h" void Observer::accessMessage() { myMessage->someFunc(); } [/source] And without pointers: [source lang="cpp"] // .h file class Observer { Message myMessage; void accessMessage(); } // .cpp file #include "message.h" #include "observer.h" void Observer::accessMessage() { myMessage.someFunc(); } [/source]
  3. eFoDay

    PHP 'include' a relative file?

    I found this link which may be of some help http://net.tutsplus....under-the-hood/ I think you need to put <?php header("Content-type: text/css; charset: UTF-8"); ?> in your .php file. Found a couple more links: http://css-tricks.com/css-variables-with-php/ http://www.barelyfitz.com/projects/csscolor/
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!