Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 32

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 82

Answer:

main()
{
static char names[5][20]={"pascal","ada","cobol","fortran","perl"};
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf("%s",names[i]);
}


Answer:
Compiler error: Lvalue required in function main


Explanation:
Array names are pointer constants. So it cannot be modified.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 32 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: