#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);
}
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 |
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 ?
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.
How we will connect multiple client ? (without using fork,thread)
how to swap 3 nos without using temporary variable
Write a program to model an exploding firecracker in the xy plane using a particle system
write a c-program to display the time using FOR loop
main() { int c=- -2; printf("c=%d",c); }
Find the largest number in a binary tree
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
write a c program to Reverse a given string using string function and also without string function