Posts

Pointers and void pointer and precedence of & and * operators in pointers.

Pointers Definition:- A pointer is a variable that stores the memory address of another another variable. void pointer :-( it can contain address of any data type ) syntax:-    void *pointer_name; example:- void *v_ptr; A void pointer does not have any data-type associated it with and can contain the address of any type of variable. example:- void v_ptr;                 char ch;                  int i;                  float fvar;                  v_ptr= &ch;                  v_ptr= &i;             ...

Program of magic. magic.cpp

#include<iostream.h> #include<conio.h> int main() {         int i,ans=0;     clrscr();     cout<<"\nChoose one number in your mind from 1 to 63 \n";     cout<<"\n1    3    5    7    9    11    13    15 \n";     cout<<"\n17    19    21    23    25    27    29    31 \n";     cout<<"\n33    35    37    39    41    43    45    47 \n";     cout<<"\n49    51    53    55    57    59    61    63 \n";     cou...