#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



#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

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

#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

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

#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

Answer / sunil v r

char *

Is This Answer Correct ?    0 Yes 0 No




#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

Answer / guest

char *

Is This Answer Correct ?    0 Yes 0 No

#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

Answer / ashish

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

Is This Answer Correct ?    0 Yes 0 No

#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared lik..

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 infinte number

4 Answers  


While compiling a c program,graphics header files are not including in my program..eg: <graphics.h>,what may be the problem...is there any environment settings exists.

2 Answers  


Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.

4 Answers  


what is diference between return 0 and return NULL??

3 Answers  


Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.

12 Answers   MIT, TCS,






here is a link to download Let_Us_C_-_Yashwant_Kanetkar

3 Answers   Microsoft,


Write a program in C to convert date displayed in gregorian to julian date

0 Answers   Wipro, HCL,


what is the self-referential structure?

1 Answers  


what is the differance between pass by reference and pass by value.

7 Answers   Infosys,


Write a program that his output 1 12 123

0 Answers  


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }

6 Answers  


void main() { int a=1; printf("%d %d %d",a,++a,a++); } the output is supposed to be 1 2 2....but it is 3 3 1 this is due to calling conventions of C. if anyone can explain me how it happens?

7 Answers  






Categories