#define DCHAR char*
typedef char* TCHAR;

if using these following variables will be declared like
DCHAR ch1, ch2;
TCHAR ch3, ch4;

then what will be types of ch1, ch2, ch3 and ch4?




Answers were Sorted based on User's Feedback



Answer / shiva

ch1,ch3 and ch4 are char* types whiel ch2 is char type.
Please let me know if I am wrong.

Is This Answer Correct ?    22 Yes 5 No

Answer / james holdcroft

Explanation:

DCHAR is a macro, which is expanded by the preprocessor.
TCHAR is a synonym for a pointer-to-char type.

After preprocessing, the code fragment expands to:

char* ch1, ch2;
TCHAR ch3, ch4;

which is perhaps more clearly written as:

char *ch1, ch2;
TCHAR ch3, ch4;

which is equivalent to:

char *ch1; char ch2;
char *ch3; char *ch4;

Is This Answer Correct ?    4 Yes 1 No

Answer / sunil v r

char *

Is This Answer Correct ?    0 Yes 0 No




Answer / guest

char *

Is This Answer Correct ?    0 Yes 0 No

Answer / ashish

ch1 and ch2 are the char * and ch2 and ch4 are char type

Is This Answer Correct ?    0 Yes 0 No

Answer / movemaker

^^All 4 will be char* types, why the hell would ch2 be char type like said above by Shiva . :P .

Is This Answer Correct ?    1 Yes 7 No

Post New Answer



More C Interview Questions

Write a program to print all the prime numbers with in the given range

8 Answers   TCS, ABC, College School Exams Tests,


What ios diff. Between %e & %f?

3 Answers   Honeywell,


dynamically allocate memory for linear array of n integers,store some elements in it and find some of them

1 Answers  


why the execution starts from main function

9 Answers  


to find the program of matrix multiplication using arrays

6 Answers   Bhel,






how to implement stack operation using singly linked list

2 Answers  


all c language question

0 Answers   Wipro,


difference between spiral and waterfall model

1 Answers  


How to write the code of the program to swap two numbers with in one statement?

2 Answers  


write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.

0 Answers   Subex,


How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)

1 Answers   Subex, iLantus,


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

0 Answers   IBM,






Categories