C Programming With Ubuntu Tutorials
This tutorial is for those people who know how to program but doesn’t know how to run the C program in Linux. The linux itself is written in C programming which means it is very friendly to programmers.
Our first program follows
To write your First program Open your Terminal in ubuntu (Short Key -Alt+Ctrl+T). Enter the command there as follows
To Open Gedit (Text editor ) .
Sudo gedit myfirstprogram.c .(give password it will open gedit and write program there and save it ,finally close that gedit) .Once again .
1) Open the terminal & enter the command as folows.
sudo gedit myfristprogram.c
Give password
It will open a gedit text file with named as myfirstprogram.c .write here your first prgram source code here save and close it .
2) Compile it the source code (myfirstprogram.c) by the following command
gcc -o myfirstprogram myfirstprogram.c
3) To see the output type the command as follows
./myfirstprogam
In this case output is
Hello wrold
Thanks
C Programming With Ubuntu Tutorials
This tutorial is for those people who know how to program but doesn’t know how to run the C program in Linux. The linux itself is written in C programming which means it is very friendly to programmers.
Our first program follows
To write your First program Open your Terminal in ubuntu (Short Key -Alt+Ctrl+T). Enter the command there as follows
To Open Gedit (Text editor ) .
Sudo gedit myfirstprogram.c .
(give password it will open gedit and write program there and save it ,finally close that gedit) .
Once again .
1) Open the terminal & enter the command as folows.
sudo gedit myfristprogram.c
Give password
It will open a gedit text file with named as myfirstprogram.c .write here your first prgram source code here save and close it .
2) Compile it the source code (myfirstprogram.c) by the following command
gcc -o myfirstprogram myfirstprogram.c
3) To see the output type the command as follows
./myfirstprogam
In this case output is
Hello wrold
Thanks
The C Programming Language is an excellent choice for beginning programmers as well as for people who do not intend to become a programmer but just want the experience of creating a program.Three things are necessary for creating C programs: a text editor, a compiler and a C standard library. A text editor is all that is needed to create the Source Code for a program in C or in any other language. A compiler is a specialized program that converts source code into machine language (also called object code or machine code) so that it can be understood directly by a CPU (central processing unit). An excellent C compiler is included in the GNU Compiler Collection (GCC). An integrated development environment (IDE) or interactive development environment is a software application that provides all things (ie,a text editor, a compiler and a C standard library etc). There are a lot of IDE available with diffrent OS look here.
Available C compilers with Diffrent OS And IDE
-------------------------------------------------------------------------------------------------
|
AMPC | Axiomatic Solutions Sdn Bhd | Yes | Yes | Yes | Proprietary | Yes |
Aztec C | Manx Software Systems | No | No | Yes CP/M, CP/M-86, MS-DOS | Proprietary | No |
Amsterdam Compiler Kit | Andrew Tanenbaum and Ceriel Jacobs | No | Yes | Yes | BSD | No |
CCS C Compiler | CCS, Inc. | Yes | Yes | Yes | Proprietary | Yes |
Ch | SoftIntegration, Inc | Yes | Mac OS X, FreeBSD, Linux, Solaris, HP-UX, AIX, Qnx | Yes | Freeware | Yes — Professional and Student versions only |
Clang | LLVM Project | Yes | Yes | Yes | BSD | No |
CParser/libFirm | Matthias Braun, Christoph Mallon and Michael Beck | Yes | Yes | Yes | GPL | No |
Digital Mars | Digital Mars | Yes | No | No | ? | No |
Dignus Systems/C | Dignus, L.L.C | Yes (host) | Yes (host) | Yes Z/Architecture | Proprietary | No |
GCC C | GNU Project | Mingw, Cygwin | Yes | Yes IBM mainframe, AmigaOS, VAX/VMS, RTEMS | GPL | NetBeans |
IAR C/C++ Compilers | IAR Systems | Yes | No | No | Proprietary | Yes |
Interactive C | KISS Institute for Practical Robotics | Yes | Unix, Mac, Linux, IRIX, Solaris, SunOS | No | Freeware | No |
LabWindows/CVI | National Instruments | Yes | Yes | Yes | Proprietary | Yes |
lcc | Chris Fraser and David Hanson | Yes | Yes | Yes | Freeware (source code available for non-commercial use) | Windows only |
Mark Williams C | Mark Williams Company | Yes | Coherent | Yes | Proprietary | Yes |
Micro C Compiler (mcc) | Roshan Snigh | Yes | Yes | Yes | Freeware (source code available for non-commercial use) | No |
MikroC Compiler | Mikroelektronika | Yes | Yes | Yes | Proprietary | Yes |
Nwcc | Nils Weller | No | Yes | No | BSD | No |
Open64 | AMD SGI Google HP Intel Nvidia PathScale Tsinghua University and others | No | Yes | Yes | GPL | No |
Open Watcom | Sybase and SciTech Software | Yes | Yes Linux | Yes OS/2, MS-DOS | Sybase Open Watcom Public License | Yes Windows only? |
Pelles C | Pelle Orinius | Yes | No | No | Freeware | Yes |
PGCC | The Portland Group | Yes | Yes | ? | Proprietary | Yes — Visual Studio on Windows |
Portable C Compiler | Stephen C. Johnson, Anders Magnusson and others | Yes | Yes | Yes | BSD | No |
Power C | Mix Software | No | No | Yes | Proprietary | No |
QuickC | Microsoft | Yes | No | No | Proprietary | Yes |
RCC (RCOR C Compiler) | Rodrigo Caetano (rcor) | Yes | Yes | No | GPL | No |
Ritchie C Compiler (PDP-11) | Dennis Ritchie and John Reiser; converted to cross-compiler by Doug Gwyn | Yes | Yes | Yes | Freeware | No |
SAS/C | SAS Institute | Yes | Yes | Yes IBM mainframe, AmigaOS, 68K, 88K | Proprietary | Yes |
Small-C | Ron Caine, James E. Hendrix, Byte magazine | Yes | Yes | Yes CP/M MS-DOS | Public Domain | Yes |
Small Device C Compiler | Sandeep Dutta and others | Yes | Yes | ? | GPL | No |
SubC | Nils M Holm | MinGW | FreeBSD, NetBSD, Linux | No | Public Domain | No |
Tiny C Compiler | Fabrice Bellard | Yes | Yes | No | LGPL | No |
(Borland) Turbo C | Embarcadero | Yes | No | Yes | Proprietary - V 2.01 freely available | Yes |
ups debugger (includes C interpreter) | Tom Hughes, Ian Edwards, and others | No | Yes | Yes Solaris, SunOS | GPL | Yes |
VBCC | Dr. Volker Barthelmann | Yes | Yes | Yes | Freeware (source code available, modification not allowed) | No |
Visual C++ Express | Microsoft | Yes | No | No | Freeware | Yes |
XL C | IBM | No | AIX, Linux | No | Proprietary | Eclipse |
-----------------------------------------------------------------------------------
I am using ubuntu (Linux os) here is the compailer is GNU GCC Because linux is an open Source and can be rewrite ,edit etc ... ................................................................
1.) Install GCC Compiler on you ubuntu (Tutorial)
(first Program)
#include<stdio.h>
int main()
{
printf(“Hello World);
return 0;
}
.....................................................
3.) Compiling the above program .
.................
Find the result Do these 2 or more times to understand and by heart
Next Tutorials
.........
The C Programming Language is
an excellent choice for beginning programmers as well as for people who
do not intend to become a programmer but just want the experience of
creating a program.
Three things are necessary for creating C programs: a text editor, a compiler and a C standard library. A text editor is all that is needed to create the Source Code for a program in C or in any other language.
A compiler is a specialized program that converts source code into machine language (also called object code or machine code) so that it can be understood directly by a CPU (central processing unit). An excellent C compiler is included in the GNU Compiler Collection (GCC).
An integrated development environment (IDE) or interactive development environment is a software application that provides all things (ie,a text editor, a compiler and a C standard library etc). There are a lot of IDE available with diffrent OS look here.
Available C compilers with Diffrent OS And IDE
-------------------------------------------------------------------------------------------------
AMPC |
Axiomatic Solutions Sdn Bhd |
Yes |
Yes |
Yes |
Proprietary |
Yes |
Aztec C |
Manx Software Systems |
No |
No |
Yes CP/M, CP/M-86, MS-DOS |
Proprietary |
No |
Amsterdam Compiler Kit |
Andrew Tanenbaum and Ceriel Jacobs |
No |
Yes |
Yes |
BSD |
No |
CCS C Compiler |
CCS, Inc. |
Yes |
Yes |
Yes |
Proprietary |
Yes |
Ch |
SoftIntegration, Inc |
Yes |
Mac OS X, FreeBSD, Linux, Solaris, HP-UX, AIX, Qnx |
Yes |
Freeware |
Yes — Professional and Student versions only |
Clang |
LLVM Project |
Yes |
Yes |
Yes |
BSD |
No |
CParser/libFirm |
Matthias Braun, Christoph Mallon and Michael Beck |
Yes |
Yes |
Yes |
GPL |
No |
Digital Mars |
Digital Mars |
Yes |
No |
No |
? |
No |
Dignus Systems/C |
Dignus, L.L.C |
Yes (host) |
Yes (host) |
Yes Z/Architecture |
Proprietary |
No |
GCC C |
GNU Project |
Mingw, Cygwin |
Yes |
Yes IBM mainframe, AmigaOS, VAX/VMS, RTEMS |
GPL |
NetBeans |
IAR C/C++ Compilers |
IAR Systems |
Yes |
No |
No |
Proprietary |
Yes |
Interactive C |
KISS Institute for Practical Robotics |
Yes |
Unix, Mac, Linux, IRIX, Solaris, SunOS |
No |
Freeware |
No |
LabWindows/CVI |
National Instruments |
Yes |
Yes |
Yes |
Proprietary |
Yes |
lcc |
Chris Fraser and David Hanson |
Yes |
Yes |
Yes |
Freeware (source code available for non-commercial use) |
Windows only |
Mark Williams C |
Mark Williams Company |
Yes |
Coherent |
Yes |
Proprietary |
Yes |
Micro C Compiler (mcc) |
Roshan Snigh |
Yes |
Yes |
Yes |
Freeware (source code available for non-commercial use) |
No |
MikroC Compiler |
Mikroelektronika |
Yes |
Yes |
Yes |
Proprietary |
Yes |
Nwcc |
Nils Weller |
No |
Yes |
No |
BSD |
No |
Open64 |
AMD SGI Google HP Intel Nvidia PathScale Tsinghua University and others |
No |
Yes |
Yes |
GPL |
No |
Open Watcom |
Sybase and SciTech Software |
Yes |
Yes Linux |
Yes OS/2, MS-DOS |
Sybase Open Watcom Public License |
Yes Windows only? |
Pelles C |
Pelle Orinius |
Yes |
No |
No |
Freeware |
Yes |
PGCC |
The Portland Group |
Yes |
Yes |
? |
Proprietary |
Yes — Visual Studio on Windows |
Portable C Compiler |
Stephen C. Johnson, Anders Magnusson and others |
Yes |
Yes |
Yes |
BSD |
No |
Power C |
Mix Software |
No |
No |
Yes |
Proprietary |
No |
QuickC |
Microsoft |
Yes |
No |
No |
Proprietary |
Yes |
RCC (RCOR C Compiler) |
Rodrigo Caetano (rcor) |
Yes |
Yes |
No |
GPL |
No |
Ritchie C Compiler (PDP-11) |
Dennis Ritchie and John Reiser; converted to cross-compiler by Doug Gwyn |
Yes |
Yes |
Yes |
Freeware |
No |
SAS/C |
SAS Institute |
Yes |
Yes |
Yes IBM mainframe, AmigaOS, 68K, 88K |
Proprietary |
Yes |
Small-C |
Ron Caine, James E. Hendrix, Byte magazine |
Yes |
Yes |
Yes CP/M MS-DOS |
Public Domain |
Yes |
Small Device C Compiler |
Sandeep Dutta and others |
Yes |
Yes |
? |
GPL |
No |
SubC |
Nils M Holm |
MinGW |
FreeBSD, NetBSD, Linux |
No |
Public Domain |
No |
Tiny C Compiler |
Fabrice Bellard |
Yes |
Yes |
No |
LGPL |
No |
(Borland) Turbo C |
Embarcadero |
Yes |
No |
Yes |
Proprietary - V 2.01 freely available |
Yes |
ups debugger (includes C interpreter) |
Tom Hughes, Ian Edwards, and others |
No |
Yes |
Yes Solaris, SunOS |
GPL |
Yes |
VBCC |
Dr. Volker Barthelmann |
Yes |
Yes |
Yes |
Freeware (source code available, modification not allowed) |
No |
Visual C++ Express |
Microsoft |
Yes |
No |
No |
Freeware |
Yes |
XL C |
IBM |
No |
AIX, Linux |
No |
Proprietary |
Eclipse |
-----------------------------------------------------------------------------------
I am using ubuntu (Linux os) here is the compailer is GNU GCC
Because linux is an open Source and can be rewrite ,edit etc ...
................................................................
1.) Install GCC Compiler on you ubuntu (Tutorial)
(first Program)
#include<stdio.h>
int main()
{
printf(“Hello World);
return 0;
}
.....................................................
3.) Compiling the above program .
.................
Find the result Do these 2 or more times to understand and by heart
Next Tutorials
.........
AVR- LCD Interfacing Tutorials
A variety of AVR micro-controller are available from Atmel having family of 8-bit,16 bit,32-bit etc along with different features. We are taking Atmega8 to interface 16X2 LCD .
16x2 LCD Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...