Home / Questions / What is wrong with this statement? myName = "Nurujjaman";
Explanatory Question

What is wrong with this statement? myName = "Nurujjaman";

👁 1,042 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

You cannot use the = sign to assign values to a string variable. Instead, use the strcpy function. The correct statement would be: strcpy(myName, "Nurujjaman");