In this code I get the folowing errors.Code:#include <iostream.h> int gettxtfiles(); int main() { gettxtfiles(); return 0; } int gettxtfiles() { int nFiles; cout<<"Enter the number of txt files"; cin>> nFiles; int i; char str[25]; char *array[100]; for(i=0;i<nFiles; i++) { cout <<"Enter file("<<i<< ")"; cin>>str; array[i] = char new[strlen(str)]; array[i] = str; cout<<array[i]; return 0; }
Can anyone help me out? Thanks
(26) : error C2062: type 'char' unexpected
MyProjects\checkoccurances\checkoccurances.cpp(33) : fatal error C1004: unexpected end of file found
Error executing cl.exe.





Reply With Quote