C语言
Ms_WangH
这个作者很懒,什么都没留下…
展开
-
C语言-输入函数getchar()与scanf问题记录
代码:#include <stdio.h>int main() { // ret 记录getchar数据 int ret = 0; // password 记录scanf数据 char password[20] = {0}; printf("Input Passsword:"); scanf("%s", password); printf("\n"); printf("Verify Password:"); ret =原创 2021-03-12 11:39:31 · 229 阅读 · 0 评论 -
CLion使用:异常-This file does not belong to any project target, code insight features...
描述:使用CLion创建新项目,以及源文件(.c),出现提示:This file does not belong to any project target, code insight features might not work properly.且代码编译运行出现错误collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: *** [项目名.exe] Error 1 mingw32-make.exe[2]: ***原创 2021-03-09 16:58:47 · 5185 阅读 · 3 评论 -
C语言练习:变量交换
说明:交换变量a与变量b值。#include <stdio.h>int main(){ int a = 3; int b = 5; // 利用中间变量交换 int tmp = a; printf("before:\ta: %d\t\tb:%d\t\ttmp:%d\n", a, b, tmp); a = b; printf("......:\ta: %d\t\tb:%d\t\ttmp:%d\n", a, b, tmp); b原创 2021-03-05 16:52:49 · 159 阅读 · 0 评论