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...


#define max 5

#define int arr1[max]

main()

{

typedef char arr2[max];

arr1 list={0,1,2,3,4};

arr2 name="name";

printf("%d %s",list[0],name);

}



#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={..

Answer / susie

Answer :

Compiler error (in the line arr1 list = {0,1,2,3,4})

Explanation:

arr2 is declared of type array of size 5 of characters. So
it can be used to declare the variable name of the type
arr2. But it is not the case of arr1. Hence an error.

Rule of Thumb:

#defines are used for textual replacement whereas typedefs
are used for declaring new types.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More C Code Interview Questions

how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

0 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


How we will connect multiple client ? (without using fork,thread)

3 Answers   TelDNA,


how to swap 3 nos without using temporary variable

4 Answers   Satyam,


Write a program to model an exploding firecracker in the xy plane using a particle system

0 Answers   HCL,


write a c-program to display the time using FOR loop

3 Answers   HCL,


main() { int c=- -2; printf("c=%d",c); }

1 Answers   TCS,


Find the largest number in a binary tree

7 Answers   Infosys,


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];

1 Answers  


write a c program to Reverse a given string using string function and also without string function

1 Answers  


Categories