Start programming with C

As we talked before about programming with Java, I find out that we are going to use C this year. I wrote some programs using C before, but it is my first time on Ubuntu.
I tried to download some IDE's but the result was not really very good, I had a lot of problems in compiling or in using the IDE itself.
Fortunately, my friend Rania tell me that I do not have to do all that as Ubuntu has a C compiler and a C++ compiler and all I have to do to compile a C or C++ file is a simple command.
Let's see how
1 - Create an empty file in any directory.
2 - Name the file for example try.c or try.cpp
3- Open the file and write your code.
Compilation
4 - Open terminal and change the directory to the one containing the source file using the command cd
                                    cd directory path
5- To compile C file type the command
                                    gcc -o ./try.o ./try.c
    To compile C++ file
                                    g++ -o ./try.o ./try.cpp
6- To run the file type the command
                                    ./try.o

Good Luck

              

Comments

  1. good luck doha , it sounds you like linux based OS
    my point of view is that linux systems much better for networking ... considering the open office you cannot change the left to right so you can type in arabic .. so simple but buggy

    ReplyDelete

Post a Comment

Popular Posts