I am trying to get the size of a file in bytes using Lstat() in unix. I am getting this error when i try to print out the value "stat.st_size" which should be where the size in bytes is stored right?
The name of the file is take in as a command line argument.
Error:
Code:
workdamnit.cpp:67: error: request for member `st_size' in `stat', which is
of non-class type `int ()(const char*, stat*)'
Code:
file.open(argv[1]);
status = lstat(argv[1], &buffer);
cout<<"the size is"<< stat.st_size<<endl;
Is this more of that crazy pointer stuff? Am I required to use them here?