two dimensional strings.
Posted on 2004-10-05
I have a structure with array of strings as a field as follows :
char *special case;
and a global variable called opr which is a char array
Now, this opr gets a line from a file each time a file read is executed and if this line satisfies a special condition then it is stored in the special case field of transaction.
Here is what i did.,
I tested the condition and then
where a is a counter.
Problem is the address of the specialcase[a] is being assigned to opr so that whenever opr gets a new value the specialcase[a] is pointing to that... which means the address of opr and specialcase[a] becomes the same... I have to get rid of this problem.
I have to only store that special case and the address of both variables should be different. How to do that... Urgent please.