Explain what is wrong with this statement? Myname = ?robin?;



Explain what is wrong with this statement? Myname = ?robin?;..

Answer / Kamal Singh Gond

The provided statement is incorrect because in C, variables cannot be directly assigned string literals using the '=' operator. To assign a string to a variable, you should use the strcpy() function or concatenation operators (e.g., char myname[20] = {"Robin"};).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

0 Answers  


Diff: between this 2 classes in terms of memory class A { int i; char c; double d; }; class A { double d; int i; char c; }; How it is calculating?

1 Answers   HCL,


What are types of preprocessor in c?

1 Answers  


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1 Answers  


What are called c variables?

1 Answers  


while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?

4 Answers   Aptech,


WHAT IS ABSTRACT DATA TYPE

4 Answers   Wipro,


All technical questions

1 Answers   TCS,


I have seen function declarations that look like this

1 Answers  


What is difference between union All statement and Union?

1 Answers   Beahead Private Limited,


write c program without semicolon

11 Answers   MindTech, TCS, Wipro,


What is string function c?

1 Answers  


Categories