Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Loonix halp

Name: Anonymous 2008-01-22 18:24

How would I make my program check if it was root?

Name: Anonymous 2008-01-22 20:02


#include <stdio.h>
#include <stdlib.h>

int main(void) {

    if(strcmp("root", getenv("USER")) == 0)
        printf("you are root\n");
    else printf("you are not root\n");

    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List