Okay, so what is the output from the program I posted?
Okay, so what is the output from the program I posted?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Isn't it easier to determine the file size before opening it ?
For example;
Code:#include <sys/stat.h> #include <stdio.h> int main() { struct stat thisInode; if ( (stat("/home/dev_x/somefile.zip", &thisInode)) == 0) printf("File size in bytes is: %ld\n", thisInode.st_size); else printf("Could not read file attributes\n"); return(0); }
stat() is Posix, which will certainly work in the unix-like environment being discussed here, but as Elysia was kind enough to point out in another thread, Posix is no longer supported by the latest versions of windows, so this code is not portable. Opening the file read-only and seeking to the end is the portable way, if portability is important.
What can this strange device be?
When I touch it, it gives forth a sound
It's got wires that vibrate and give music
What can this thing be that I found?