#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 / 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 |
What is the difference between char a[] = "string"; and char *p = "string"; ?
14 Answers Adobe, Honeywell, TCS,
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is the use of volatile?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
0 Answers Aspire, Infogain, TISL,
When should I declare a function?
What is a null pointer in c?
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
What are pragmas and what are they good for?
What is floating point constants?
FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY?
What is the difference between struct and typedef struct in c?
program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5