Difference between revisions of "Getting Started With C"

From CsWiki
Jump to: navigation, search
(introduction)
(Getting Clion for personal use)
Line 11: Line 11:
 
Clion is an IDE, which is compatible with linux ,mac osx and windows.<br/>
 
Clion is an IDE, which is compatible with linux ,mac osx and windows.<br/>
 
For external installation of clion,follow this <span class="plainlinks">[http://wiki.cs.huji.ac.il/wiki/Get_JetBrains_Student_License guide]</span><br/>.
 
For external installation of clion,follow this <span class="plainlinks">[http://wiki.cs.huji.ac.il/wiki/Get_JetBrains_Student_License guide]</span><br/>.
and acquire a student licence for  jetbarins products. then download and install Clion from jetbarins site and enter the license. .<br/>
+
and acquire a student licence for  jetbarins products. then download and install Clion from jetbarins site and enter the license.<br/>
after installing Clion, a compiler is needed to be installed, such as gcc, which is included in cgywin or minGW.  
+
after installing Clion, a compiler is needed to be installed, such as gcc, which is included in cgywin or minGW.
  
 
===Compiling in C===
 
===Compiling in C===

Revision as of 14:24, 5 August 2018

introduction

This page describes the general surrounding for coding in c programming language, and running your C code.
Coding in C language can be done in text editors such as (vim, gedit, nano),terminal in linux or mac, or visual studio in windows.
also available are IDE(Integrated Development Environment) programs, such as netbeans,code::blox,clion etc...
Clion IDE by jetbrains is available at the Aquarium computers, it can be found at:

 applications Tab → Programming→ Clion. 

Clion.png

Getting Clion for personal use

Clion is an IDE, which is compatible with linux ,mac osx and windows.
For external installation of clion,follow this guide
. and acquire a student licence for jetbarins products. then download and install Clion from jetbarins site and enter the license.
after installing Clion, a compiler is needed to be installed, such as gcc, which is included in cgywin or minGW.

Compiling in C

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

How to Compile With GCC

After finishing writing down the code in C , open the terminal , select the location of the .c file with :cd FILE_PATH/.
Then use the compiling command in at the terminal window.:

gcc -Wextra -Wall -Wvla -std=c11 file_name.c -o output_file_name.

if errors are raised ,the file will not be compiled until the problems will be solved. if warnings are raised ,</br> the file may or may not be compiled, it is preferable to handle the warnings and compile again. .
after file had compiled , an output file with the designated name will be created at the same
directory as the original file.
to run it, just select the output file in the terminal and press enter.
compiling exmaple, showing the command in terminal, where test.c is the c file that the user has wrote,
and result is the output file which was created in the compiling process and can run in the terminal

Compiling example.png

Comparing Codes

For comparing two code files or more, the user may use the diff command which can be read about at this Link.