Thread: stupid questions

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    38

    stupid questions

    Okay, here we go again,
    This is not exactly a programming code question. I feel pretty sure I can write the code.

    This question is specific to borland 6 c++
    My instructor is having us write a program using a class file he wrote, and a file called student.h, he then gave us another file to show how to manipulate the class.

    From this we write code to do a list of specific items.

    here is the problem (giving permission to laugh!)
    When i open my two .cpp files and the student.h file, go to compile, i do not think that the student.h file is being included (linked to), also this does not seem to do anything (the program)

    If some one could please tell me how to include a .h file (header file) that is written seperately in the project in borland then I think I can tackle this.

    Sincerely
    Jess
    please visit our site, it is not finished but it is on its way!
    [Moderator edit: Link removed]

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    The header file gets included by a #include preprocessor statement in one or both of your cpp files. Check those. One or both should have this include statement.

    If that is done, the .h file will be compiled because the previous step (preprocessing) will simply grab the text inside the .h file and copy it to the cpp file replacing the #incude preprocessor directive.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    38
    so i just open all three files, how do i make sure that the compiler is using the project.cpp file instead of the student.cpp file as the main running running file.

    thanks for the help
    my brain is tired!

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    125
    There's not really such a thing as main file... there is a main function, generally called "main" for commandline programs or "WinMain" for Windows programs. So long as all of your cpp files have only one main function, you should be fine.
    Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5.

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    38
    Thanks for all the help, I was opening to many files and not thinking it through
    Got it first time after closed everything out walked away, came back and reopened files

    thanks again

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple (stupid) questions - no programming
    By jvu in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 02-07-2009, 04:44 PM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Stupid Questions.....
    By Krak in forum C++ Programming
    Replies: 7
    Last Post: 07-08-2005, 03:11 PM
  4. Yet Another Of My Stupid Questions
    By Geolingo in forum C++ Programming
    Replies: 3
    Last Post: 10-01-2003, 06:18 PM
  5. Companies and their stupid interview questions...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 01-30-2003, 06:00 PM