|
-
February 19th, 2004, 06:15 PM
#1
C++ basics
Hello.
I am new to this board and to c++ , so i got couple basic questions to ask:
1.Why do i have to use semicolon after class declaration:
EX:
class CError
{
public:
};
2.Why do we not need to use semicolons after writing code into functions, and after main?I mean,
is there any particular reason for this to be this way , or is this just how c++ is?Is there a rule on
where ";" are suppoused to be ?
3.when you define a function fo some class ,you use :: before the functions name:
void CTest::Function1()
{
}
What are they for??What do they mean?
4. What is the diffrence between | and ||??
5. what is a string?
and do i need to #include <string> to use "string teststring;"?
6.does this line create an object of a ifstream class named fin.
ifstream fin;
7.why do we need a ifstream class object in this function:
getline(fin, szLine);
??
8.why do we use :: in something like std::somefunction. What is the meaning of it?
9.What does this line mean: HWND hWndConsole = NULL;?? Why is it equal to NULL?
10.In the next code snippet:
char szTitle[MAX_PATH];
GetConsoleTitle( szTitle, MAX_PATH );
why does the array have max_path as a # of array items??i tried to chage it but it jsut says that the "newname" is not
defined?
11.HANDLE OutputH; this is a handle to a console inwod as i undrestadn..well what does that mean?
12. also people say that a class in an object, but then what is the object that is done by:
CTestClass objecthere;
?
I know this is kind of a big post , but i am jsut starting out wiht C++ and i got some code snippets and here is some stuff
that i do not undestand. I would really apriciate it so that somone could post an answer to this.
Thx in advance
Last edited by rvr_coder; February 19th, 2004 at 06:21 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|