I was hopping someone can help me with my C code. I'm getting this error:
error: incompatible type for argument 2 of ‘strcpy’
strcpy(tmp, (SB->jNodes[j]));
Here's my code for where the error happens:
for (int j = 0; j < 20; j++) {
iNode *tmp = malloc(sizeof(iNode));
strcpy(tmp, (SB->jNodes[j]));
if(tmp->size == -1) {
iNode *oldRoot = SB->root;
iNode *newShadowRoot;
strcpy(newShadowRoot, oldRoot);
strcpy(tmp, newShadowRoot);
strcopy(SB->jNodes[j], tmp);
break;
}
free(tmp);
}
and here's my data structures:
typedef struct iNode
{
int mode;
int id;
int size;
int pointers[NUM_POINTERS];
} iNode;
typedef struct superBlock
{
int magic_number;
int block_size;
int num_blocks;
int num_inodes;
iNode *root;
iNode jNodes[20];
} superBlock;