Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 1.49 KB

README.md

File metadata and controls

84 lines (57 loc) · 1.49 KB

Custom C Compiler Command

A Powershell Command that writes:

gcc -o filename.exe filename.c && filename.exe

by simply writing:

c filename 

[without any .c&.exe]

Installation

Download the c.ps1 file.

Add the following code in your Powershell Profile/Config file.

#C_Script
$c_script = Join-Path $PSScriptRoot ".\custom\c.ps1"
. $c_script  | Invoke-Expression

Change the location inside:-

""

To your downloaded .ps1 file's location.

If you don't know the location of your Powershell Profile

Just type the following command in your terminal:-

echo $PROFILE

And you'll see something like:-

C:\Users\Yoo\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

And you should be done with the Installation.

Actual Use

To use the command write a C program in your current dir or change to a already written one.

Example C program: helloworld.c

#include<stdio.h>
int main() {
    printf("Hello, World!");
    return 0;
}

Now to Compile and Run the code simple type:

c helloworld

Like This:

Screenshots

Command: App Screenshot Output: App Screenshot

Contributing

Contributions are always welcome!

See c.ps1|Source Code for ways to get started.