[C Language] implement strlen

[C Language] implement strlen # Include # include // Method 1: Use the pointer int my_strlen (const char * str) {assert (str); int count = 0; while (* str ++) {count ++;} return count;} int main () {char * str = "abcdef"; int len = my_strlen (str)

C language: Simulate the strstr function. If it is a substring, the string following the substring is output; otherwise, null is output.

C language: Simulate the strstr function. If it is a substring, the string following the substring is output; otherwise, null is output. # Define _ CRT_SECURE_NO_WARNINGS 1 # include # include # include char * my_strstr (char * arr1, char * arr2)

It is difficult and difficult to flip the binary position of C language !!!

It is difficult and difficult to flip the binary position of C language !!!Problem description: Write the function: unsigned int reverse_bit (unsigned int value); the value returned by this function is the value after the binary bit mode is flipped

Basic operations of two-way linked list in C Language

Basic operations of two-way linked list in C Language // Header file # pragma once typedef int DataType; typedef struct LinkList {DataType _ data; struct LinkList * _ next; struct LinkList * _ prev;} LinkList, * pLinkList; void InitList (pLinkList

C language, c

C language, cI. Task One class has m girls and n boys (m is not equal to n). Now we have a dance. The boys and girls sat on the chairs on both sides of the dance floor. At the beginning of each song, one of the boys and the girls danced together,

C-language puzzle game 1

C-language puzzle game 1 Include # include # include void print_menu () {printf ("************************* \ n "); printf ("********* 1. start ****** \ n "); printf (" ********* 0. exit ****** \ n "); printf ("*********************** \ n");}

Use C language to calculate a simple mathematical formula

Use C language to calculate a simple mathematical formula // Calculate the sum of the first five items of Sn = a + aa + aaa + aaaa + aaaaa, a is a number // such as 2 + 22 + 222 + 2222 + 22222 # include int main () {int num = 0; int n = 0; int sum

Compile a program to count the numbers, spaces, and the number of occurrences of all other characters in the input string.

Compile a program to count the numbers, spaces, and the number of occurrences of all other characters in the input string. # Include int main () {char a = 0; int num_count = 0; int space_count = 0; int other_count = 0; // note that a = getchar ()

Simple plotting tool implemented by Opencv and opencv plotting tool

Simple plotting tool implemented by Opencv and opencv plotting tool The first time I wrote a blog, I was a newbie. I recently started learning Opencv and tried to write a simple drawing tool (currently I only wrote the line and eraser sections, and

Use C programming to print the Yang Hui triangle

Use C programming to print the Yang Hui triangle # Include # include # define line 9 // The number of m in the n-th row can be expressed as C (n-1, m-1), that is, the number of m-1 elements from n-1 different elements. // That is: num! /(Count! *

C-c to c ++ annotation Conversion

C-c to c ++ annotation Conversion # Include typedef enum Tag {C_ANNOTAION_START = 0, // start of C annotation C_ANNOTAION_END = 1, // end of C annotation} Tag; typedef enum State {SUCCESS = 1, // successful OPEN_FILE_ERROR, // NO_MATCH when opening

String inversion --- pointer, reverse --- pointer

String inversion --- pointer, reverse --- pointer   1 # define _ CRT_SECURE_NO_WARNINGS 2 # include 3 # include 4 # include 5 6 int inverse (char * str1, char * str2) 7 {8 char * p1 = str1; 9 char * p2 = str2; 10 while (p1  

C elementary applets

C elementary applets1. print the prime number between And: # include # include int main () {int I, a; for (I = 101; I int main () {int I, j; for (I = 1; I int main () {int I; for (I = 1000; I

Program soul-algorithm, program soul-Algorithm

Program soul-algorithm, program soul-Algorithm Nikilaus Wirth formula: program = Algorithm + Data Structure The textbook holds that: program = Algorithm + Data Structure + programming method + language tools and environment. Concept of Algorithms

Error-prone knowledge points in C Language

Error-prone knowledge points in C Language1. Structure Calculation // Struct BBB {// long a; // char c1; // char c2; // long B; // long c; //} * p; // sizeof (struct BBB) = 16; // int main () // {// p = (struct BBB *) 0x100000; // printf ("0x % x",

How many words are updated in a string? C language, Tan haoqiang, example 6.8

How many words are updated in a string? C language, Tan haoqiang, example 6.8For example, 6.8 enter a line of characters and count the number of words. Separate words with spaces. Original solution: Check the characters one by one from the first

Arm Learning & mdash; Summary of bit operations, arm learning Summary

Arm learning-Summary of bit operations and arm learning Summary In the process of learning arm, the sensory register basically does not provide bitwise operations, but the overall operation,The overall operation is to note that when assigning a

Use the C language to output color-coded text on the Win console.

Use the C language to output color-coded text on the Win console. After learning the C language for so long, I have been stuck at the level of compiling the "console" program. However, black windows and white texts are boring. However, as a

Objective-C and Swift

Objective-C and Swift   Important Materials Using Swift with Cocoa and Objective-C official documentationWhy do we need to mix data? Language Development Trend (tietong), Swift ranking continues to rise, and OC ranking is required for normal

C language initial contact

C language initial contactThese days I have a preliminary understanding of the C language and read a lot of grammar knowledge. # Include int main () {printf ("hello world \ n"); return 0 ;}  This is my first simple program design. I believe most

Total Pages: 275 1 .... 155 156 157 158 159 .... 275 Go to: GO

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.