Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


C eksempel med argv, argc og system()

Author:mike - Thu Aug 21 21:57:03 2003

#include <stdio.h>

int
main(int argc, char **argv)
{
        if (argc < 2) {
                printf("Hva har du kog i fister?\n");
        } else
        if (!strcmp(argv[1], "-GiB")) {
                printf("Gibibyte\n");
                system("df -h");
        } else if (!strcmp(argv[1], "-GB")) {
                printf("Gigabyte\n");
                system("df -H");
        } else {
                printf("%s [-GiB|-GB]\n", argv[0]);
        }
}


Dedikeret til EizCold, SCOTD (SlamCoderOfToday)
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk