Example: argc/argv
#include <stdio.h>
#include <sys/stat.h>
int main( int argc, char *argv[])
{
if( argc == 2 )
{
struct stat buf;
if( stat( argv[1], &buf ) != -1 )
printf( “file %s has size %d\n”, argv[1],
buf.st_size );
}
return( 0 );
}
Previous slide
Next slide
Back to first slide
View graphic version