hello, excuse this work since im not that familiar with C but my university assignment says i must use it for this application.
I have to make a application to copy files with confirm overwrites i seem to have hit an issue
Im compiling this code using the Cygwin VM running on Windows XP compiling with GCC. can anyone see what is wrong with this code ?
i compile in Cygwin using...Code:#include <stdio.h> #include <sys/stat.h> #include <stdlib.h> #include <string.h> struct stat src_info; struct stat dest_info; int main(int argc, char **argv[]) { //make sure we have a valid number of arguments if (argc == 3) { printf("Source: %s\nDestination: %s\n", argv[1], argv[2]); if (_stat(argv[1], &src_info) == -1) { printf("Error with source could not get i-node\n"); exit(0); } if (_stat(*argv[2], &dest_info) == -1) { printf("Error with destination could not get i-node\n"); exit(0); } } }
$ gcc -o bin/safecp safecp.c
safecp.c: In function `main':
safecp.c:15: warning: passing arg 1 of `_stat' from incompatible pointer type
thank you for your help sam





Reply With Quote