Hello everyone!
I'm trying to do somethig like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#include "stdafx.h"
#include <iostream>
class Numbers
{
public:
int First(int);
private:
void Second();
};
int main()
{
int a;
Numbers Num;
a = 5;
Num.First(a);
system("pause");
return 0;
}
int Numbers::First(int a)
{
std::cout << "In Function First\n";
std::cout << "a:\t" << a << std::endl;
Second();
return 0;
}
void Numbers::Second()
{
std::cout << "In Function Second";
}
|
As we can see, I pass from main to function 'First' a parameter type int.
Now lets pretend I want to pass from function 'First' to function 'Second' a type char, how I do this?
This example is working great but I want instead of pass a int, pass a char.
For the char I want to read from a note pad using fread, then allocate the text readed in a type char then pass it as parameter.
Thanks!
btw this is my first post (:
and Congratulations about the tutorials, excellent tutorials in this page.
And one question, If I would like to share my codes here it is permitted here in this forum? So people can use it if they need.
Or here is just for answer questions?
Sry Im new :P ! & Thanks!