Q.1 - Where n how do i code, compile and execute c and c++ program?
Ans- Turbo C Compiler, can be downloaded from here. It itself is a complete solution[IDE] for C Programming, where you can code, compile and execute a c and c++ program.
Sample Program- HelloWorld.cpp
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
cout<<"Hello world";
getch();
}
from top line-
1. #include statement used for adding header files.
2. void main(){} is the starting point of the program. Runtime looks for main method and starts executing statements within its body.
3. clrscr(), getch() and cout are predefined methods that are made available in our sample program by including iostream.h and conio.h
In linux environment you will require to install gc++ .
Use any text editor to write program.
For compilation use: gcc program.cpp -o program
to execute : program
---------------
Scope resolution operator(::) Global variables access in class or, fully-qualified name to members of class.
accessor, mutator, manager funtions. nested functions.
concrete and abstract class.
pointers
reference
clrscr(), getch(), setw, ios:fixed, cout<<, cin>>, endl.
maths.h, manip.h
access specifier to define what will be inherited.
disambiguation (argument matching to resolve function instance as per provided actual parameters to formal parameters defined for function.)
class vs struct
share
typedef for aliasing types.
inline functions for better performance.
constructors(general/parameterized, default, copy) & destructor.
Friends.
passing array as parameter to function.