Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

helllo sir ,
what is the main use of the pointer ,array ,and the
structure with the example of a programe

Answer Posted / fazlur rahaman naik

With the help of pointer we can access a variable
address.with that we can change the value of the
variable.for eg:

main()
{
int a = 10;
int *x;

x = &a;

printf("a = %d\n",a);
*x = 978;
printf("a = %d\n");
}

now the value of the a is 978.

if we pass a pointer to a variable to a function then the
value of that variable will be chageed if we change it in
that function.
for eg:

main()
{
int b = 87;
int *x;
x = &b;
fun(x);
printf("b = %d\n");
}

fun(int *x)
{
*x = 879;
}

here the value of the b will be 879.

Array : Array is a collection of variable of similar types.
i.e. it can b an collection of n number of integers or arry
of characters etc.
for eg:

Take a examination marks of a class.it could b a float
value or a integer value.Then u need to take five variables
of float type or interger type.Insted of that u can take an
array of float or integer type.

float marks[n];

arrays r mainly used for strings.

char string[n];

Structure:
The structure is a collection of variables of various data
types.

the best example for this is employee details or student
details.

struct emloyee
{
char name[25];
int age;
float salary;
char mobile[15];
char desig[25];
};







Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

4185


What does 2n 4c mean?

1188


How to Throw some light on the splay trees?

1004


Describe the difference between = and == symbols in c programming?

1298


What is c system32 taskhostw exe?

975


What is the basic structure of c?

1010


Explain argument and its types.

993


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

2257


What is pivot in c?

974


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1259


How can you invoke another program from within a C program?

1023


What is function and its example?

1110


What are the functions to open and close file in c language?

1131


How to explain the final year project as a fresher please answer with sample project

909


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2018