strcpy error

Pages: 123
do I need to allocate the memory to files when I use pointers in struct?

What do you mean by that?

If you have:
1
2
3
4
5
6
7
typedef struct  {
  char * name;
  char * filename;
} FILES;

// and you do
FILES foo[3];

Then foo refers to a automatically (stack)allocated memory block that contains six pointers, two for each struct. Pointers, nothing more.
Topic archived. No new replies allowed.
Pages: 123