Huawei machine test questions 1-10

Length of the last word of the string #include<stdio.h> #include<string.h> const int maxn=5010; int main(){ char str[maxn]; gets(str); int len=strlen(str); int num=0; for(int i=len;i>=0;i--){ if(str[i]!=' '&& str[i]!='\0') num++; else if(str[i]=='\0') continue; else break; ...

Posted by micksworld on Fri, 04 Mar 2022 17:09:12 +0100

[C language intensive instruction] C language file operation

catalogue 1. Type of document 1.1 procedure documents 1.2 data files 1.3 file name 2. Opening and closing of files 2.1 document pointer 2.2 opening and closing of documents 3. Sequential reading and writing of documents 4. Random reading and writing of documents 4.1 fseek 4.2 ftell 4.3 rewind 5. Text files and binary files 6. Dete ...

Posted by SpectralDesign.Net on Fri, 04 Mar 2022 15:56:08 +0100

C language programming problem

C language programming problem Assignment of production practice (curriculum design) Fundamentals of subject or task programming (C) week 2 Professional computer science class level 21 related professional classes Instructor Chen Huafeng, Hu Meiyan, Graduate Teaching Assistant Internship tasks and objectives Through this training, master the ...

Posted by xoligy on Fri, 04 Mar 2022 11:58:16 +0100

Detailed notes on the most complete C language functions in history

function catalogue What is a functionLibrary functionCustom functionFunction parametersfunction callNested call and chained access of functionsDeclaration and definition of functionsFunction recursion 1. What is the function Function f(x)=2*x+1 in Mathematics But what are the functions in C language? Defined in Wikipedia as a subroutine. ...

Posted by moleculo on Fri, 04 Mar 2022 07:55:36 +0100

UC growth path 9

Review: UC growth path 1 UC growth path 2 UC growth path 3 UC growth path 4 UC growth path 5 UC growth path 6 UC growth path 7 UC growth path 8 1, Registration of last words function atexit(3) review UC growth path 8on_exit(3) #include <stdlib.h> int on_exit(void (*function)(int , void *), void *arg); //Function: register the last word ...

Posted by kapishi on Fri, 04 Mar 2022 05:06:14 +0100

[C language learning notes - 6]

Statement: due to the limited level of the author, this article will inevitably have errors and inaccuracies. I also want to know these errors. I sincerely hope the readers can criticize and correct them. [contact information] 1583598623@qq.com [update record] April 19, 2021 (first update) [Corrigendum record] none 1. What is ...

Posted by mikkex on Fri, 04 Mar 2022 04:53:19 +0100

The parent process waits for the child process to exit the wait and waitpid functions

catalogue 1. The exit state of the child process is not collected by the parent process and becomes a dead process (zombie process) 2. The exit status of the child process is collected by the parent process and the wait function is called 2.1: the status parameter of the wait function is null. 2.2: the status parameter of the wait function ...

Posted by peyups on Fri, 04 Mar 2022 03:44:57 +0100

C language - branch and loop

1, Foreword C language is a structured programming language 1. Sequential structure 2. Select structure 3. Circulation structure Life is nothing more than these three structures: some people follow the steps, some people face choices, and some people go back and forth Focus on selection statements, circular statements and extended jump ...

Posted by PRSWeb on Fri, 04 Mar 2022 01:10:09 +0100

C language function

Functions are snippets of code that can be reused. Library function (if it is written by others, you can use it directly) Standard library functions printf, strlen,system System library function Sleep Many third-party library functions can be found on github Write your own function Function composition: ret_type fun_name(para1, * ) { stat ...

Posted by dannylewin on Thu, 03 Mar 2022 20:06:25 +0100

Chapter IV selection of structural programming ##C language programming (4th Edition)

if statement Example 4.1 input the scores of two students a and b, and output the highest score. The preparation procedure is as follows: #include <stdio.h> int main() { float a,b,max; printf("please enter a and b:"); scanf("%f,%f",&a,&b); if(a>=b) max=a; else max=b; printf("max=%6.2f\n",max); ret ...

Posted by dave_biscuits on Thu, 03 Mar 2022 19:42:14 +0100