Hello, I'm a complete beginner at C++, and I wanted to ask some n00b questions. I couldn't find/understand answers anywhere on the web, nor on these forums...so, here they are:
1. What's the differrence between:
and
I know, it's a pointer, but why do people use char *a more than just 'char a'? What's the purpose of it? How can I use it and find it useful?
2. How to use volatile?
3.
Code:
*pVal = atof(szVolAdjust);
Again, why * ?
4. Is network programming easy?
5. How to get the value of getch() into a variable?
6.
Code:
static void cap_set_pg()
What's the use of static here?
7. Why can't dev-c++ compile most of those complex programs?
8.
Code:
struct b{
int g;
char *jam;
char* unjam;
}
and
Code:
typedef struct{
int g;
char *jam;
char* unjam;
}
What's the use of typedef here?
9. How to make the program quit if(quit=1) ?
10. How to make my program to open another program? (For example, a CD autorun program shows welcome message, and then opens the folder of CD contents)
11. Program:
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream read("file.txt");
int count;
int count2;
cout<<count<<"\n"<<count2;
cin.get();
}
file.txt:
How to make the program assign the values from file.txt into variables count and count1?
12. How to access a structure from a class?
Code:
class fragile
{
public:
fragile();
~fragile();
struct tnt
{
int h;
};
};
int main()
{
fragile fr;
fr.tnt dyna;
fr.dyna.h=6; //doesnt work
13. How to get the cout<<'ed text into a variable?
14. Whats the use of '?' in C++?
15. What is union REGS?
16. What is ?
Sorry for such stupid questions, I know you won't want to waste your time to answer them, but please understand me, I want to strenghten my C++ knowledge and help others too.