#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

in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

0 Answers  


Explain the difference between exit() and _exit() function?

0 Answers  


can we change the default calling convention in c if yes than how.........?

0 Answers   Aptech,


What is the purpose of type declarations?

0 Answers  


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

2 Answers  






How can you avoid including a header more than once?

0 Answers  


what would be the output of the follwing struct st { char name[20]; int i; float f; }; main() { struct st emp = {"forum"}; printf("%d %f",emp.i,emp.f); }

4 Answers  


is it possible to create your own header files?

0 Answers  


What is the use of header?

0 Answers  


What is difference between union All statement and Union?

0 Answers  


What is the equivalent code of the following statement in WHILE LOOP format?

0 Answers  


write a c program to accept a given integer value and print its value in words

4 Answers   Vernalis, Vernalis Systems,


Categories