tirengarfio wrote:
jim marshall wrote:
This should be "struct openCmd_t *p_open;", you forgot the 'struct'
keywork.
add the following include:
#include "memory.h"
Thanks but it doesnt work..The error is the same
GARFF
jim marshall wrote:
Works fine for me:
[myuser - ~]$ cat estructuras.h
struct openCmd_t {
char username[20];
char password[20];
};
[myuser - ~]$ cat main.c
#include <memory.h>
#include "estructuras.h"
main(int argc, char *argv[])
{
char *comando;
struct openCmd_t *p_open;
memcpy(comando, p_open, sizeof (*p_open)); /////////// error line
}
[myuser - ~]$ gcc --version
gcc (GCC) 4.1.0
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
[myuser - ~]$ gcc main.c
[myuser - ~]$
Also tried with an older version of gcc:
[myuser - ~]$ cc --version
cc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
[myuser - ~]$ cc main.c
[myuser - ~]$