Difference between break and continue C string functions

Source: Internet
Author: User

1. Difference Between break and continue:

Break: jumps out of the loop and runs down.

Continue: Terminate this loop and perform the next loop.

For example:

For (INT I = 0; I <7; I ++)

{

If (I = 0)

{

Break;

// Continue;

}

Printf ("Haha ");

}

Printf ("Haha ");

When I = 0, break prints out Haha, and continue does not print, but enters the next loop.

2. String functions in C:

Header file: <stdio. h>

Output Function: int puts (Const char *Str);

A positive value is returned successfully, and an error EOF is returned.

Input Function: char * gets (char *Buffer);

The input value is returned successfully. The NULL pointer returned by the error does not use "space" as the input end identifier, but uses "enter" as the end identifier.

Header file: <string. h>

Connection function: char * strcat (char *Strdestination, Const char *Strsource);

Strdestination is returned successfully. The returned error is null.

Copy function: char * strcpy (char *Strdestination, Const char *Strsource );

Comparison function: int strcmp (const char *String1, Const char *String2);

The return value is <0, 0,> 0 (string1 to string2)

String Length: size_t strlen (const char *Str);

Returns the string length, excluding the terminator '\ 0'

 

Related Article

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.