#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 |
Write a code on reverse string and its complexity.
Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc
Why do we use c for the speed of light?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
There are 8 billiard balls, and one of them is slightly heavier, but the only way to tell was by putting it on a weighing scale against another. What's the fewest number of times you'd have to use the scale to find the heavier ball?
What is the difference between Printf(..) and sprint(...) ?
What are external variables in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
write a program in c to print **** * * * * ****
what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"
What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation
What are the differences between Structures and Arrays?