You have to just change to user privileges to root to run the file like you can run the file with
first compile:
gcc filename.c -o out
then run with root:
sudo ./out