# include <iostream.h>
void main()
{
byte* a;
long* b;
cout<<sizeof(a)<<endl;
cout<<sizeof(b)<<endl;
}
float pay;
float *ptr_pay;
pay=2313.54;
ptr_pay = &pay;
#include<iostream.h>
void main()
{
int a;
int *aPtr; // aPtr is a pointer to an integer
a = 7;
aPtr = &a; //aPtr set to address of a
cout << “The address of a is “ << &a
<< “\nThe value of aPtr is “ << aPtr;
cout << “\n\nThe value of a is “<< a
<< “\nThe value of *aPtr is “ << *aPtr
<< endl;
}
int ara[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int *ip1, *ip2;
#include <iostream.h>
void swap(int a[], int *c1, int *c2, int *d1, int *d2);
void main()
{
int a[2], c1, c2,d1,d2;
int *x1, *x2, *y1, *y2;
a[0] = 1 ; a[1] =2;
c1 = 1; c2 =2;
d1 = 1; d2 =2;
x1 = &c1; x2 = &c2;
y1 = &d1; y2 = &d2;
swap(a, x1,x2,y1,y2);
cout<<a[0]<<a[1]<<” “
<< *x1<<*x2<<” ”
<<*y1<<*y2;
swap(a, x1,x2,y1,y2);
cout<<a[0]<<a[1]<<” “
<< *x1<<*x2<<” ”
<<*y1<<*y2;
}
void swap(int a[], int *c1, int *c2, int *d1, int *d2)
{
a[0] = 2 ; a[1] =1;
*c1=2, *c2 =1;
int* temp = d1;
d1 =d2;
d2 = temp;
}
int findMax(int * vals, int numEls)
{
int j, max = *vals;
for (j = 1; j < numEls; j++)
if (max < *(vals + j))
max = *(vals + j);
return max;
}
#include<iostream.h>
#include<string.h>
#define MAX 80
void str_output(char *);
int main()
{
char a[MAX], b[MAX];
cin.getline(a, MAX, '\n');
str_output(a);
cout << endl;
strcpy(b,a);
str_output(b);
cout<< endl;
return 0;
}
void str_output(char *ptr)
{
………..
}
struct Date
{
int month;
int day;
int year;
}
Comments, questions, feedback, criticisms?