0

I have an array, which i want it common to both the f1.cpp and f2.cpp .

since f1.cpp will be used to store some values in it and f2.cpp has to use it for some other computations , is there any way i can share these 2 variables .

well i initially thought of files , but they dont completely solve my problem.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by WaltP
0

Create a header file with: extern int array[]; in it and include the header in the .cpp file without the array declaration..

0

i didnt completely get u ..

U mean to say
insitlaly i create a header file like

#include<shared_data>
extern int array[];


and then in normal code , i should directly use array ; ?

Will the data stored by the first program into this array can be used by another program .. ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.