#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

what is the Output? int a=4 b=3; printf("%d%d%d%d%d%d",a++,++a,a++,a++,++a,a++); printf("%d%d%d%d%d%d",b--,b--,--b,b--,--b,--b);

10 Answers   IBM,


What is the difference between if else and switchstatement

0 Answers  


Explain output of printf("Hello World"-'A'+'B'); ?

0 Answers  


which of the function operator cannot be over loaded a) <= b)?: c)== d)*

10 Answers   Cisco, CTS, Google, HCL, HP,


inline function is there in c language?

4 Answers  






write a program to create a sparse matrix using dynamic memory allocation.

0 Answers  


What is Memory leakage ?

2 Answers   HCL,


What are the application of void data type in c?

0 Answers  


how to estimate the disk access time? e.g. the time between read one byte and another byte in the disk.

3 Answers   Google,


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


Result of the following program is main() { int i=0; for(i=0;i<20;i++) { switch(i) case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf("%d,",i); } } a)0,5,9,13,17 b)5,9,13,17 c)12,17,22 d)16,21 e)syntax error

8 Answers   IBM,


What is self-referential structure in c programming?

0 Answers  


Categories