How to pass a value between two cpp file and a main.cpp by pointers?

Posted on 2007-04-03
Last Modified: 2013-11-20
How to pass a value between two cpp file and a main.cpp by pointers?
Question by:9Tails
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 32

Accepted Solution

Daniel Wilson earned 500 total points
ID: 18847672
Well, you haven't given us a lot here.  I take it you're trying to call functions in the other files with pointer parameters?

void Fun1(void * Param);

void Fun1(void * Param);

#include "File1.h"
void Fun1(void * Param){
  //Do something here with the parameter

#include "File2.h"
void Fun2(void * Param){
  //Do something here with the parameter

#include "File1.h"
#include "File2.h"
int main(){
  int *p_I;
  int j;
  char p_C[100];

  //do something



LVL 53

Expert Comment

ID: 18848921
Does DanielWilson's reply answer your question, or are you looking for something else ?

Expert Comment

ID: 18851020
use extern variable name .   or have global pointer use it across

Expert Comment

ID: 19203758
i feel point split should be done

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Not needed 13 129
Question to Pivot table 1 67
How to determine if the result of an equation is an integer in C++? 3 29
Developing a front end to SPLUNK 1 62
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question