Forum: C Dec 5th, 2007 |
| Replies: 8 Views: 1,425 Thank you very much! That was the problem! |
Forum: C Dec 4th, 2007 |
| Replies: 8 Views: 1,425 #include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{ FILE *fp;
DIR *d;
struct dirent *dir; |
Forum: C Dec 4th, 2007 |
| Replies: 8 Views: 1,425 When I tried this, I got two warnings:
1. assignment makes integer from pointer without cast
2. passing arg 1 of 'strcpy' makes pointer from integer without cast
I have it starting at 2... |
Forum: C Dec 4th, 2007 |
| Replies: 8 Views: 1,425 I changed line 23 to
filenames = (char *) malloc(sizeof *filenames);
and I changed line 24 to
strcpy(filenames,dir->d_name);
I know that this solves the problem I was having because when I... |
Forum: C Dec 4th, 2007 |
| Replies: 8 Views: 1,425 This program should traverse a directory and save the file names into an array so I can manipulate data within the files. The problem is that the program prints the name of the files in the first... |
Forum: C Dec 4th, 2007 |
| Replies: 7 Views: 4,055 Could you please explain to me how this is done? I wanted to save some file names into an array so I could manipulate the text in the files, but I can't get past this problem and I have tried to save... |