News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

including multiple file

Started by Aristotle, July 21, 2013, 10:38:58 AM

Previous topic - Next topic

Aristotle

I created five files :main.cpp, c++_1.cpp,c++_1.h,c++_2.h,c++_2.cpp; c++_1.cpp have c_1() function and c++_2.cpp have c_2() function, after including all the file in the same directory  I called the two function c_1() and c_2() from main I could call c_1() individually but if I include c_2() there is an error message   

E:\codeblockprograms\c++ program\main.cpp           error:                             'c_2' was not declared in this scope|
||=== Build finished: 1 errors (0 minutes, 0 seconds) ===|

I am confused, any help please

BlueHazzard

1. This is no c::b related question, but a general c++ question, so this is the wrong forum...
2. pls make your question a bit more clearer...
for example list all files and add the code like this:
main.cpp:
#include "c++_1.h"

c++_2.cpp:
c_1()
{}


etc...

3. Don't use special characters (like ++ ) in your path/file names this will cause problems...

greetings