Python 3 calls and encapsulates and calls c program

Python 3 calls and encapsulates and calls c program First, let's look at an example: Import c program implementation: import time from ctypes import * def main(): num = int(input("Please enter an integer value:")) result = 0 start_time = time.time() result = cdll.LoadLibrary("./add.so") result.my_add(num) end_tim ...

Added by cainscripter on Mon, 14 Feb 2022 11:07:49 +0200

[C advanced level] brother Peng takes you to play with · strings and memory functions

Hello, everyone. I'm safe and sound. catalogue ​ 1, Introduction to common string library functions 1,strlen() Implementation of strlen by user-defined function simulation 2,strcpy() Implementation of strcpy by user-defined function simulation 3,strcat() Implementation of strcat by user-defined function simulation 4,strcmp() Implem ...

Added by poison on Mon, 14 Feb 2022 02:06:07 +0200

C Primer Plus Chapter 15 (bit operation)

1. Binary, bit and byte Numbers based on 2 are called binary number s 1 1 0 1 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 13 1.1 binary integer C language uses byte s to represent the required size of the character set of the storage system 1 byte = 8 bits Interpret bit pattern s in different ways for 1 byte (8 bits) unsi ...

Added by amy_ewe on Sun, 13 Feb 2022 18:08:01 +0200

Day 16: string function

The content of these two days is becoming more and more difficult, and it takes more time to understand the implementation of functions. Although half of today's knowledge has been briefly mentioned before, it still takes some time to really master it. Find string length strlen String function with unlimited length strcpy strcat strcm ...

Added by phppssh on Sun, 13 Feb 2022 14:30:23 +0200

[C language] address book - dynamic and static implementation

preface: I believe everyone knows the address book Its functions include: adding, deleting, checking and modifying This issue is to realize an address book implemented in C language Continue what we talked about last time-- Dynamic memory allocation Then I will implement it in the two ways given in the title I Implementation of st ...

Added by jkewlo on Sun, 13 Feb 2022 07:47:27 +0200

Complexity [data structure and algorithm]

What is a data structure Data structure is the way that computers store and organize data, and there are one or more specific relationships between them What is an algorithm Algorithm: a well-defined calculation process that takes an input and produces an output The algorithm is a series of calculation steps to convert the input ...

Added by Crow on Sat, 12 Feb 2022 15:59:37 +0200

[YBT2022 winter vacation Day6 C] [luogu CF1063F] substring selection / String Journey (SAM) (line segment tree) (multiplication)

Substring selection / String Journey Title Link: YBT2022 winter vacation Day6 C / luogu CF1063F General idea of the topic Give you a string. If you want to find the maximum K satisfaction, you can choose k disjoint substrings from left to right at a time to meet that the former is the real substring of the latter. thinking First of all, le ...

Added by jrose83 on Sat, 12 Feb 2022 09:10:21 +0200

There is a string in which each character can only be 0 or 1. At most, we can choose to change k zeros into 1, and find the length of the longest continuous 1 substring after transformation.

The second question of winter vacation homework of programming in freshman semester #include <stdio.h> #include <math.h> #include <string.h> int numofone(char* num) { int count = 0; int big = 0; for (int i = 0;i < strlen(num);i++) { if (num[i] == '1') { count++; } if (big < count) { big = count; } ...

Added by electricblue on Sat, 12 Feb 2022 07:26:11 +0200

Function and program structure of the strongest move

1. Write in front Previously, we learned to process data and manage simple processes, but the program can't have only one method. In this way, the program is more chaotic, so we need to split and combine the structure of the program accordingly, so it's easier to maintain. 2. Basic knowledge of function Let's write a program that contains a ...

Added by AutomatikStudio on Sat, 12 Feb 2022 06:47:30 +0200

Detailed explanation of minesweeping C language writing

I believe everyone must be familiar with mine sweeping! But do you believe that you can make a simple minesweeping game only with some basic knowledge of C language? hhh, today, I will lead you into mine sweeping and explore the mystery of its basic algorithm. 1, Basic ideas First of all, since we are playing games, we should design the corre ...

Added by faizulbari on Sat, 12 Feb 2022 05:58:55 +0200