今日:0  |  文章:52
admin
小绿叶技术博客 Lv2 超级管理员

c 语言进制数 转换 10 16 2

#include <stdio.h> #include <string.h> #include <math.h> int s10z16() { int x; printf("请输入10进制数,转为 16 进制: "); scanf("%d", &x); char arr[100] = { 0 }; //因为十六进制中会出现A\B\C\D\E\F等字符,所以保存余数的数组类型应定义为char int i = 0
 
 1881   2023-05-05
admin
小绿叶技术博客 Lv2 超级管理员

shell 自动生成 CMakeLists.txt 自动编译c语言

#!/bin/bash # 自动化编译 c/c++ dir=`pwd` ; echo "欢迎使用自动化汇编程序,当前路径为: $dir" touchCMake(){ sudo touch CMakeLists.txt ; sudo chmod 777 CMakeLists.txt ; echo " project(eisc) #项目名 cmake_minimum_required(VERSION 3.10) # 编译要求:cmake 要大于最低版本 3.1 set(CMAKE_C_COMPIL
 
 1928   2023-04-17
admin
小绿叶技术博客 Lv2 超级管理员

c++ 文件操作大全,增删改查

/******************************************************** Copyright (C), 2016-2018, FileName: main Author: woniu201 Created: 2018/08/31 Description: 文件操作:读取指定行,删除指定行,修改指定行 ********************************************************/ #include <iostr
 
 1178   2023-01-31
admin
小绿叶技术博客 Lv2 超级管理员

在指定位置插入字符串 c++

#include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { char dest[30] = "12345"; char str[] = "abc"; int n,i=0,j=0; printf("请输入插入位置>>>"); scanf("%d",&n); for(i=5;i>=n;i--){ dest[i+3]=dest[i]; }
 
 1128   2023-01-31
admin
小绿叶技术博客 Lv2 超级管理员

c++ 文件读写

#include <iostream> #include <cstring> #include <string> #include <stdlib.h> // system 命令使用头文件 #include <fstream> // 读写文件 /*------ mkdir 命令 ------*/ #include <sys/stat.h> #include <
 
 1830   2023-01-31
admin
小绿叶技术博客 Lv2 超级管理员

Linux c++ 创建目录

#include <sys/stat.h>   #include <sys/types.h> #include <cstddef> #include <string.h> #include <stdio.h> void mkdir_path(char *p_cMkdir); int main() { char path[60]="/home/salman/30"; mkdir_path(path); } void mkdir_
 
 1287   2023-01-29
admin
小绿叶技术博客 Lv2 超级管理员

c 结构体 指针

#include <stdio.h> struct namebiao{ char *name; //姓名 int num; //学号 int age; //年龄 char group; //所在小组 float score; //成绩 }; // 定义一个结构体 自定义名字 namebiao struct namebiao shuzu[]= { {"Li ping", 5, 18, 'C', 145.0}, {"Zhang
 
 1019   2023-01-17
admin
小绿叶技术博客 Lv2 超级管理员

c++ 文件写入

#include <fstream> #include <iostream> using namespace std; //--- 文件和流 --- // ofstream 输出文件流,用于创建并写入文件; ifstream 输入文件流,用于读取文件; fstream 文件流,同时有前面两种功能 int main () { char data[100]; // 以写模式打开文件, 定义一个文件打开函数 SetFile ofstream SetF
 
 1754   2022-12-29
admin
小绿叶技术博客 Lv2 超级管理员

c 语言字符串操作函数

#include <stdio.h> #include <string.h> // 字符串操作函数 :1 strcpy 2 memcpy 3 strncpy 4 memset 5 strcat 6 strlen 7 strcmp // 1 和 2 复制并且替换原变量,1 仅支持字符串; 3 替换字符串开头多少位; 4 将变量二的多少位添加到 变量一的尾部 // 5 字符串末尾追加; 6 计算字符串长度; 7 比较两个字符串,= > < 返回 0 1 -
 
 2002   10  2022-12-15
admin
小绿叶技术博客 Lv2 超级管理员

c语言-kvm虚拟机管理案例

#include <stdio.h> #include <string.h> // 1.输入和输出如打印字符, 2.各种字符和数组操作 #define Lengtha 30 #define Lengthb 30 // 容器要大于 存放量,否则溢出 struct myIN { char name[Lengtha]; char suzhi[Lengthb]; }; // 定义结构体 名字: myIN 成员: name 和 suzhi ,它们为数组 特征是 中括号,长度
 
 1945   2022-12-12
头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息