ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
How do I declare a pointer to an array?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do I declare a pointer to an array?
Answer
# 1
char (*)p[100];
Here p is a pointer to an array of 100 character elements..
 
Is This Answer Correct ?    2 Yes 5 No
K.thejonath
 
  Re: How do I declare a pointer to an array?
Answer
# 2
data_type (*ptr)[];
ex: int (*ptr)[10];

pointer to arry of 10 elements
 
Is This Answer Correct ?    4 Yes 2 No
Sureshreddy
 
 
 
  Re: How do I declare a pointer to an array?
Answer
# 3
you do not need to declare a pointer to any array..

an array itself is a constant pointer..

a[10] is equivalent to *a.
 
Is This Answer Correct ?    4 Yes 1 No
Shruti
 
  Re: How do I declare a pointer to an array?
Answer
# 4
could any one help me out how this pointer to an array 
organized in the memory?

Eg.,
int (*p) [3] = (int (*)[3])a;

Here *p == p, how?

Thanks in advance!
 
Is This Answer Correct ?    0 Yes 2 No
Guest
 
  Re: How do I declare a pointer to an array?
Answer
# 5
int (*ptr)[10]; 
is the proper declaration of pointer to an array, i.e. ptr 
is a pointer to an array of 10 integers .

Note:  
int *ptr[10];
which would make ptr the name of an array of 10 pointers to 
type int.
 
Is This Answer Correct ?    3 Yes 0 No
Chittaranjan
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the use of #pragma pack, wer it is used? Wipro1
pointer_variable=(typecasting datatype*)malloc(sizeof(datatype)); This is the syntax for malloc?Please explain this,how it work with an example? Excel2
WAP – represent a char in binary format Motorola4
Describe advantages and disadvantages of the various stock sorting algorithms Microsoft1
Write a program to find the smallest and largest element in a given array in c language Microsoft3
wap in c to accept n number display the highest and lowest value  2
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed  4
Write a program for the following series: 1*3*5-2*4*6+3*5*7-4*6*8+.................up to nterms Convex-Digital4
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3 Honeywell2
a C prog to swap 2 no.s without using variables just an array? TCS4
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student" IBM4
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<= Siemens10
what is the output of the following program? #include<stdio.h> void main() { int x=4,y=3,z; z=x-- -y; printf("\n%d %d %d",x,y,z); }  10
What's wrong with "char *p; *p = malloc(10);"?  5
Difference between null pointer and dangling pointer? Wipro3
what does " calloc" do? Cadence6
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?  1
What is meaning of "Void main" in C Language. TCS8
any string of bits of length 'n' represents a unique non- negative integer between.............?  2
why we shiuld use main keyword in C  5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com