problème avec strcpy(prog C sous linux)
Salut !
J'ai écris deux méthodes une pour insertion d'un élément dans un tableau et l'autre vérification d’existence, je programme sous linux quand je compile avec gcc -c nomfinchier.h
j'ai les erreur suivante :
Code:
1 2 3
| TS.h: In function insertTS:
TS.h:20:3: attention : passing argument 1 of strcpy makes pointer from integer without a cast [enabled by default]
/usr/include/string.h:128:14: note: expected char * __restrict__ but argument is of type char |
voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
typedef struct dictionary {
char *entite;
char *type;
} elt;
elt TS[1000];
int nb=0;
//fonction d'insertion dans la table de symbole
void insertTS( char *entite, char type,int nb_sym) {
strcpy(entite,TS[nb_sym].entite);
strcpy(type,TS[nb_sym].type);
}
void lookup(char *entite,char *type) {
int indice=((7 *(int)entite+11)%800)%1000;
if(TS[indice].entite==NULL && strcmp(TS[indice].entite,entite))
insert(entite,type,indice);
else
printf("cette entite existe deja \n");
} |