Sharing C "Hello word" with QQ friends"

Source: Internet
Author: User
Tags c hello world

First, I declare that I am also a cainiao.

Today, I am playing a game at http://www.xiapy.com. Suddenly remembered such a T-shirt Hello word! So I changed the QQ personalized signature to "Hello word", and then ......

Cool
Hello world, will you write it?

Cool

Help me write a C Hello world. I'll show it to you, too.

Cool

Check this

# Include <stdio. h>

Int main (INT argc, char ** argv)
{
Printf ("Hello world \ n ");
Return 0;
}

Tell me what the error is and what it means

Cool
Haha No
Show you this: http://zh.wikipedia.org/wiki/Hello_World

Kong cup Nan

You wrote something strange.

Cool

Why is it strange?
Do you mean two parameters of Main?

Kong cup Nan

# Include <stdio. h>

Int main (INT argc, char ** argv)
{
Printf ("Hello world \ n ");
Return 0;
}
Yes

Cool

Haha
It is estimated that you do not know the main parameter.

Kong cup Nan
So what do you mean to write?
Int main (void)

???

Cool
Search for the main parameter.
Fun

  Kong cup Nan

When I learned any Hello word output, I didn't see the basic 2 or 3 lines defined in this definition.

Cool

Hello world can be very complicated to write. Let me help you write it.

Kong cup Nan

Why complicate simple programs?

Cool
Must comply with standards

Kong cup Nan
Dizzy. You can write it.

Cool

# Include <stdio. h>

Static int
Parsestartoptions (INT argc, char ** argv)
{

If (argc> 1)
{
Printf ("Hello % s", argv [1]);
}
Else
{
Printf ("Hello world \ n ");
}
Return 0;
}

Int main (INT argc, char ** argv)
{
Int ret;
Ret = parsestartoptions (argc, argv );
If (RET)
{
Exit (0 );
}
Return 0;
}

Kong cup Nan
What is a ** pointer **?

Cool
Pointer to the pointer, which means that the 2nd parameters of main must be directed to a char8 address.
There is still room for optimization for that program. Do you want to check it out?

Kong cup Nan
Of course, see

 

Cool

The program just considered the situation where there are parameters and no parameters.
But when there are multiple parameters, there will be problems or omissions.
So you can change it again.

# Include <stdio. h>

Static int
Parsestartoptions (INT argc, char ** argv)
{
Int I;

If (argc> 1)
{
Printf ("hello ");
For (I = 1; I <argc; I ++)
Printf ("% s", argv [I]);
Printf ("\ n ");
}
Else
{
Printf ("Hello world \ n ");
}
Return 0;
}

Int main (INT argc, char ** argv)
{
Int ret;
Ret = parsestartoptions (argc, argv );
If (RET)
{
Exit (0 );
}
Return 0;
}
Two Parameters of main are described in detail as "Hello World ".

Cool

So remember not to say hello World
This is not for beginners, or for Nb-savvy people.

Kong cup Nan

Understand

Cool

Hello world decides the Language Style

Kong cup Nan
Determine the Language Style
Why?

Cool
Just as you said.
My main function determines that it is input on the terminal.
It is not in line with Hello World
But your understanding of the program
Almost no one writes windows code.
Main (INT argc, char ** argv)
However, this must have been the case for early dos programmers.

Kong cup Nan
Pair
But your understanding of the program
Not the most important thing about technology is the language base.

Cool
Well
That's why
Hello worle for beginners, they know how the program runs.
But for a sophisticated programmer, it is a work of art.
MiniGUI Hello world, you can use this keyword to search and see how many errors are there?

Kong cup Nan
About 2,770 items match the MiniGUI Hello World query results. The following are 1st-10 items. (The search time is 0.24 seconds.

Cool
Look at these questions
So it's hard to say hello workd.

Kong cup Nan
Indeed

Cool
Have fun

Kong cup Nan
Fun
Hello word today

Cool

Hey

It will take a while to write a program.

I know it's another thing.
 

Cool
Today is not very busy, so I have time to tell you.
Haha

Http://blog.csdn.net/haoel/archive/2009/04/29/4134807.aspx

Look at this... It's also fun!

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.