We want to declare x, y and z as pointers of type int. The alias name given is: intpt The correct way to do this using the keyword typedef is:
Answer: D
It shows the correct way to declare x, y and z as pointers of type int using the keyword typedef. The advantage of using typedef with pointers is that we can declare any number of pointers in a single statement.
Enter details here
Which of the following keywords is used to define an alternate name for an already existing data type?
Answer: C
The keyword typedef is used to define an alternate name for an already existing data type. It is mostly used for used defined data types.
Enter details here
The keyword typedef cannot be used to give alias names to pointers.
Answer: B
The statement given in the question is incorrect. The keyword typedef can be used to give an alias name to all data types as well as pointers.
Enter details here
In the following code, the P2 is Integer Pointer or Integer?
typedef int *ptr;
ptr p1, p2;
Answer: B
No answer description available for this question.
Enter details here
We want to create an alias name for an identifier of the type unsigned long. The alias name is: ul. The correct way to do this using the keyword typedef is ____________
Answer: A
The syntax of the keyword typedef is: keyword
Hence if we want to create an alias name (ul) for an identifier of type unsigned long, the correct way to do this would be: typedef unsigned long ul;
Enter details here
Which of the following is FALSE about typedef?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
typedef struct student
{
char *a;
}stu;
void main()
{
struct student s;
s.a = "hey";
printf("%s", s.a);
}
Answer: D
No answer description available for this question.
Enter details here
In the following code what is 'P'?
typedef char *charp;
const charp P;
Answer: A
No answer description available for this question.
Enter details here
What’s the meaning of following declaration in C language?
int (*p)[5];
Answer: D
No answer description available for this question.
Enter details here
One of the major difference between typedef and #define is that typedef interpretation is performed by the _________________ whereas #define interpretation is performed by the _____________
Answer: C
The major difference between typedef and #define is that the typedef interpretation is performed by the compiler whereas #define interpretation is performed by pre-processor.
Enter details here