I am trying to run the simple program below and are receiving the errors "Lvalue required in function main()" when I am trying to reassign the variable name to something else. Why and how would I go about this correctly?
Code:#include <stdio.h> int main() { char name[100]; int i = 0; printf("Please enter you're name \n"); printf(">>>"); scanf("%s", name); if (name == "John") { name = "George W. Bush"; } if (name == "Doogie"){ name = "Clifford the big red dog"; } for (i = 0; i < 1000; i++){ printf("Welcome %s! \n", name); } return 0; }



LinkBack URL
About LinkBacks



