I
inuy4sha
1) I know that when I create a class I can access its instance methods
(functions) through the sintax
classname.method(parameters);
so I'm asking you: what does the std::cout means.. what is this sintax
telling about the relation between the "std" and the "cout" ? I hope I
explained my self..
2) I'd like to create a class with its methods and private data.. I
see that most of the time the methods are specified in a cpp file
while the "class interface" (I'm probably thinking in a java way) that
specifies which methods are included and if they're private or public,
is included in a header file: for istance:
// FILE MyClass.h
class MyClass{
private:
method1();
int [] ...;
public:
MyClass();
MyClass(....);
method2()
};
// FILE MyClass.cpp
MyClass::MyClass(){
...
}
......
then I can make a main in a third file and tells the compiler to
include the two file MyClass.cpp and MyClass.h ?? Is this the right
way to work out things?
Thanks in advance
(functions) through the sintax
classname.method(parameters);
so I'm asking you: what does the std::cout means.. what is this sintax
telling about the relation between the "std" and the "cout" ? I hope I
explained my self..
2) I'd like to create a class with its methods and private data.. I
see that most of the time the methods are specified in a cpp file
while the "class interface" (I'm probably thinking in a java way) that
specifies which methods are included and if they're private or public,
is included in a header file: for istance:
// FILE MyClass.h
class MyClass{
private:
method1();
int [] ...;
public:
MyClass();
MyClass(....);
method2()
};
// FILE MyClass.cpp
MyClass::MyClass(){
...
}
......
then I can make a main in a third file and tells the compiler to
include the two file MyClass.cpp and MyClass.h ?? Is this the right
way to work out things?
Thanks in advance