0
char in[100], *temp[10],var[10][10];
    int i, n = 0,fulval=0;
	double val[10];
	var[10][]="ANS";

it should be simple but i cannot figure it out. I want to assign "ANS" to var[0][0,1,2] but it did not work?

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by gkaykck
0

you have the val declared twice -- once on line 1 and again on line 3. You can not use the same variable name twice like that.

line 4: you have to call strcpy() to do it: strcpy(var[0],"ANS"); The = assignment operator will not work on character arrays.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.