Thursday, July 1, 2010

My first C Programming in Linux

I am good in C, C++ programming in windows using visual studio editor, but I don't know how to write, compile and run a C, C++ program in Linux. Just I learned. I like to share that with all.

Open any editor like vi and create a file "hello.c" and write a simple hello world program.
To create a file in using VI editor.
Open Terminal window then type following command to create a file.
vi hello.c
Now press the insert key and type the following program.


#include<stdio.h>
int main()
{
printf("hello world");
return 1;
}



now press type following command to save and exit
:wq
To Compile type the following command
cc hello.c -o hello
To run type the following command
./hello

I Can't able to Access HTTPS website

Once I had a problem in accessing all https website like online banking websites, gmail, from my PC with Windows XP. But i can able to access all other wesites. I thought some virus or spyware may got installed. I checked with different Anti-virus scanner, but I can't able to find any thing. Then I checked "host" file in "c:\windows\system32\drivers\etc\" path, there also i didn't find any problem.

At last I found the problem, This happend for me all because of CMOS battery failure.
When CMOS battery failed, I used to press F1 to continue loading in default settings.
So my system got set very very old date and time.Then I set the correct date . So problem solved and now I can able to access all https websites.