-4

I am switching from PHP to C++ and I have this questions.

I have main.cpp,true.cpp,false.cpp and header.h.

The header.h has a function "Function_go_to_requested_page.cpp()"

main.cpp looks like this

#include header.h
bool x;
cin>>x;

Function_go_to_requested_page(x) // It should take to page true.cpp if x=1                else to false.cpp

I don`t know how to define this function in header file,as I will be calling this function in both in true.cpp and false.cpp .

Thanks for your time.

Omer
  • 1
  • 1
  • 1
    I would say, no research effort. – lapk Aug 27 '13 at 16:30
  • 2
    Based on your last two questions I suggest you start with a good C++ book: [The Definitive C++ Book Guide and List](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) – Blastfurnace Aug 27 '13 at 16:31
  • sounds like a homework question to me, try a C++ book, or a C book, or google. – bizzehdee Aug 27 '13 at 16:31
  • 2
    You are missing some basic fundamentals of C++, this site is a specific Q&A site and not a tutorial site. Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See the [Stack Overflow question checklist](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist). There are many good tutorial sites you can go to first, when you encounter issue on one of those feel free to come back here and ask a new question (following the steps on the checklist first). – Scott Chamberlain Aug 27 '13 at 16:31
  • You really ought to stick to PHP, they are VERY different languages, find yourself a good book (there is a book list somewhere on this website!) the example misses a semi-colon, and files work differently than they do in PHP, you understand modular complication and linkage to see why this question is so wrong. – Alec Teal Aug 27 '13 at 16:31

1 Answers1

0

how to link header files in c++

This might shed some light on how to do it. Header files essentially define what's going to be in a .cpp file. I would get a book this is pretty basic stuff.

Community
  • 1
  • 1
progrenhard
  • 2,333
  • 2
  • 14
  • 14