Difference between revisions of "Getting Started With C"

From CsWiki
Jump to: navigation, search
(introduction)
(How to Compile With GCC)
Line 17: Line 17:
  
 
===How to Compile With GCC===
 
===How to Compile With GCC===
After finishing writing down the code , open the terminal , then select the folder where your file is saved by using :'''cd PATH/'''.<br/>
+
After finishing writing down the code in C , open the terminal , then select the folder where your file is saved by using :'''cd PATH/'''.<br/>
 
Then use the compiling command:
 
Then use the compiling command:
 
  '''gcc -Wextra -Wall -Wvla -std=c11 file_name.c -o output file name'''.<br/>
 
  '''gcc -Wextra -Wall -Wvla -std=c11 file_name.c -o output file name'''.<br/>
if warnings are raised , the file will not be compiled, and the user will have to handle the causes to the warnings and try again.<br/>
+
if warnings are raised , the file may or may not be compiled. if the file has not compiled, the user will have<br/>
 +
to handle the causes to the warnings and errors and after that try again until the warnings are gone.<br/>
 
else,the file will be compiled and an output file with the name you have designated will be created at the same<br/>
 
else,the file will be compiled and an output file with the name you have designated will be created at the same<br/>
 
directory as the compiled file.<br/>
 
directory as the compiled file.<br/>
 
after all the warnings has been solved, in the termimal, select the file and press enter, and the file will <br/>
 
after all the warnings has been solved, in the termimal, select the file and press enter, and the file will <br/>
 
run at the terminal.<br/>
 
run at the terminal.<br/>

Revision as of 16:28, 2 August 2018

introduction

This page describes the necessary surrounding for coding in c programming language and running your code.


introduction

Coding in C language can be done by different IDE’S. The recommended on is Clion IDE by jetbrains.
In the Aquarium computers, it can be found at:

 applications Tab → Programming→ Clion. 

Clion.png
For windows installation of clion,follow this guide for getting a student licence from jetbarins to all of jetbrains software.
after installing Clion, a compiler is needed, such as cgywin or mingw which are available online at and .

Compiling in C

Compiling is the process of converting one programing language to another. It is executed by a computer program called a compiler.
In The school’s computer system, GCC is the default compiler used by courses for compiling needs.

How to Compile With GCC

After finishing writing down the code in C , open the terminal , then select the folder where your file is saved by using :cd PATH/.
Then use the compiling command:

gcc -Wextra -Wall -Wvla -std=c11 file_name.c -o output file name.

if warnings are raised , the file may or may not be compiled. if the file has not compiled, the user will have

to handle the causes to the warnings and errors and after that try again until the warnings are gone.

else,the file will be compiled and an output file with the name you have designated will be created at the same
directory as the compiled file.
after all the warnings has been solved, in the termimal, select the file and press enter, and the file will
run at the terminal.