#include<iostream> #include<vector> #include<cstdlib> #include<ctime> #include<algorithm> using namespace...
C++ stream manipulators (USE OF SETPRECISION(),CONVERSION FROM DECIMAL TO HEXA ND OCTAL DIGITS ETC)
#include<iostream> #include<iomanip> #include<cmath> using namespace std; int main(){ int number; cout<<...
VECTORS USING ITERATORS
#include<iostream> #include<string> #include<vector> using namespace std; int main(){ vector<string>ammunition...
ADNANCED STRUCTURE USAGE (DIGGING DEEP IN TO STRUCTTS: CONCEPT BUSTER)
#include <iostream> using namespace std; struct nameinfo{//temprlate for struct string fname;//members of struct string lname; ...
Passing structures(structs) in to functions
#include <iostream> using namespace std; struct stationary{ int price; char book[30]; char author[30]; }; void myfunction(int ...
pointers to structures(structs)
#include<iostream> using namespace std; #include<string> int main(){ struct codes{ int isbn; string description; };...
Nested structs
#include<iostream> using namespace std; #include<string> #include<iomanip>//included for using setw(10) function int...
structures c++
#include<iostream> using namespace std; #include<string> #include<iomanip>//included for using setw(10) function int...
structures usage
// struct #include<iostream> using namespace std; #include<string> # define total 90 int main(){ struct abc{//structure ...
Pointers for strings
#include<iostream> using namespace std; void main() { char arr1[15]={"HAPPY BIRTHDAY"}; char *arr2[]={"HELLO...
4 ways of acessing arrays
#include"stdafx.h" #include<iostream> using std::cout; using std::endl; int main() { int b[] = { 10, 20, 30, 40 }; // ...
Passing arrays in to functions
#include<iostream> using std::cout; using std::endl; #include<iomanip> using std::setw; void modifyArray( int [], int ); /...
Arrays usage in c++
#include<iostream> using namespace std; int main() { int n[ 10 ]; // n is an array of 10 integers // initialize elements of arra...
Preprocessor directives involving concatenation
#include"stdafx.h" #include<iostream> #define JUST_CHECKING //preprocessor directives #define LIMIT 4 #define TEXT 1 #d...
Preprocessor c++ made easy
#include "stdafx.h" #include<iostream> using namespace std; #define SQUARE(X) (X)*(X) //macro to calculate square of a nu...
using function pointers
#include<iostream> using namespace std; void add(int a,int b); void divide(int a,int b); void multiply(int a,int b); void sub...
So whats your lucky colour (C++ program to use array of pointers)
#include<iostream> using namespace std; int main(){ char*pstart[]={"red","blue","orange","pink...
C++ jumble word game
#include<iostream> #include<cstdlib> #include<ctime> #include<string> using namespace std; int main(){ str...
Searching a number using Arrays
#include<iostream> using namespace std; int sum=0,ar[10],value,found=0; int main(){ for(int x=0;x<10;x++){ cout<<...
relationship between pointers and arrays (beginners)
#include<iostream> using namespace std; int a[]={1,23,22}; int b[]={2323,3}; int main(){ char*point="i love c++ programming ...
Usage of sizeof() operator in c++
#include <iostream> using std::cout; using std::endl; int main() { char c; short s; int i; long l; float f; double d; long ...
types of functions and their usage
#include<iostream> using namespace std; int a=56,b=56,c=56; int passbyvalue(int x); void passbyreference(int &x); void passby...
understanding pointers
#include<iostream> using namespace std; int main(){ int *point,**point1,***point2,****point3,a; point=&a; point1=&poin...
Subscribe to:
Posts (Atom)