首页
关于
归档
赞赏
声明
留言
友链
Search
1
又拍云CDN的正确打开方式
4,997 阅读
2
腾讯2021届秋招校园招聘前端笔试真题(第一次笔试)
4,913 阅读
3
Gradle/Maven配置国内镜像源(以Android Studio为例)
4,879 阅读
4
中国建设银行甘肃省分行2021秋季校招面试经验
4,869 阅读
5
VScode配置C/C++环境
4,864 阅读
杂谈
生活
技术
随笔
登录
Search
标签搜索
windows
github
gitee
Python
镜像
Android Studio
Android
秋招
招聘
宝塔面板
vscode
git
php
服务器
CDN
阿里云
onedrive
oneindex
网盘
C语言
来不及午觉
累计撰写
87
篇文章
累计收到
50
条评论
首页
栏目
杂谈
生活
技术
随笔
页面
关于
归档
赞赏
声明
留言
友链
搜索到
5
篇与
的结果
2020-03-04
VScode编写C语言中文乱码问题
说明在VScode上写C语言,总是出现中文乱码问题,找了好多方法都不管用,最后发现了一个方法解决了问题,特此记录。步骤 打开Windows控制面板,点击时钟和区域,然后点击图中按钮 点击管理,更改系统区域设置 勾选图中选项,然后点击确定,重启电脑 写在最后很多博文上都让修改VScode的文件编码格式为GB2312,但不管用,而且,这个方法是全局修改,如果开发的其他项目是utf8编码,会有影响。
2020年03月04日
2,005 阅读
0 评论
0 点赞
2020-03-04
VScode运行C程序无法输入值
说明如题,由于VScode输出是只读状态,所以当程序里有scanf这类函数时,程序就无法继续运行,只能重启VScode或者在任务管理器里关闭程序。步骤1.点击运行之后,输出页面无法输入值,再次点击运行,则显示程序已经在运行。2.打开文件 -> 首选项 -> 设置,在上方的搜索框里输入run in terminal,勾选此项设置3.再次运行程序,在终端界面输入值,完成!
2020年03月04日
2,315 阅读
0 评论
0 点赞
2020-03-03
VScode配置C/C++环境
说明Dev C++停止更新很久,codeblocks开源但也许久没有发布新版,加上这两个都没有代码提示,语法高亮也很丑,所以便使用VScode开发,特此记录。步骤1.安装MinGW# 官网在线安装 https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download # 官网离线安装 https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/设置如下图:建议安装在C盘根目录,不要安装在文件夹名有空格的目录下,本文安装目录为C:\MinGW\2021.1.6 更新上述下载网站版本过旧,且国内网速过慢,建议使用下述地址,版本新网速快下载地址:mingw2.下载安装好后请将此目录添加为系统环境变量C:\MinGW\mingw64\bin3.打开VScode,安装扩展Code Runner和C/C++4.新建一个文件夹,此文件夹为以后C/C++程序文件夹新建的这个文件夹即工作目录,配置好以后,可以在此目录下继续新建文件夹,不需要再次配置5.在新建文件夹内新建.vscode,内含launch.json,tasks.json,c_cpp_properties.json三个文件,文件内容如下:launch.json{ "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", // 配置名称,将会在启动配置的下拉菜单中显示 "type": "cppdbg", // 配置类型,这里只能为cppdbg "request": "launch", // 请求配置类型,可以为launch(启动)或attach(附加) "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", // 将要进行调试的程序的路径 "args": [], // 程序调试时传递给程序的命令行参数,一般设为空即可 "stopAtEntry": false, // 设为true时程序将暂停在程序入口处,一般设置为false "cwd": "${workspaceFolder}", // 调试程序时的工作目录,一般为${workspaceFolder} "environment": [], "externalConsole": true, // 调试时是否显示控制台窗口,一般设置为true显示控制台 "MIMode": "gdb", "miDebuggerPath": "C:/MinGW/mingw64/bin/gdb.exe", // miDebugger的路径,注意这里要与MinGw的路径对应 "preLaunchTask": "gcc", // 调试会话开始前执行的任务,一般为编译程序,c++为g++, c为gcc "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": false } ] } ] }tasks.json(C语言){ "version": "2.0.0", "command": "gcc", "args": [ "-g", "${file}", "-o", "${fileBasenameNoExtension}.exe" ] }tasks.json(C++){ "version": "2.0.0", "command": "g++", "args": [ "-g", "${file}", "-o", "${fileBasenameNoExtension}.exe" ], // 编译命令参数 "problemMatcher": { "owner": "cpp", "fileLocation": [ "relative", "${workspaceFolder}" ], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } } }c_cpp_properties.json{ "configurations": [ { "name": "Win32", "includePath": [ "C:/MinGW/mingw64/include/**", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed", "C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include" ], "browse": { "limitSymbolsToIncludedHeaders": true, "databaseFilename": "" } } ], "version": 4 }includePath获取方法1.打开cmd,输入gcc -v -E -x c++ -,结果如下:Using built-in specs. COLLECT_GCC=C:\MinGW\mingw64\bin\gcc.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib ' Thread model: win32 gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project) COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=core2' '-march=nocona' C:/MinGW/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/cc1plus.exe -E -quiet -v -iprefix C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/ -U_REENTRANT - -mtune=core2 -march=nocona ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++" ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32" ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward" ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include" ignoring nonexistent directory "C:/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../include" ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed" ignoring duplicate directory "C:/MinGW/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include" ignoring nonexistent directory "C:/mingw810/x86_64-810-win32-seh-rt_v6-rev0/mingw64/mingw/include" #include "..." search starts here: #include <...> search starts here: C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++ C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32 C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed C:/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include End of search list.2.将第19-24行得到的路径替换到c_cpp_properties.json文件includepath中的第7-12行注意,includepath中第一行为安装目录下include目录,其余为刚刚cmd中获取到的目录,书写注意格式。运行程序在工作目录下新建welcome.c文件,内容如下:#include<stdio.h> int main() { printf("welcome to 124.221.171.144!"); return 0; } 点击右上角的 图标运行代码,结果如下:写在最后建议配置文件内容均使用C++版本,也就是命令使用g++而不是gcc,C语言可以在C++环境下运行,相反则不行。
2020年03月03日
4,864 阅读
0 评论
0 点赞
2019-07-20
VScode新建文件初始化模板
介绍如题,使用VScode新建一个文件的时候,比如 vue 文件,我们需要手动输入以下内容:<template> </template> <script> export default { name: "", data() { return { } } } </script> <style scoped> </style>每次新建都需要这么做,显得很麻烦,所以,我们需要配置一个模板配置步骤点击顶部菜单,文件-首选项-用户代码片段, 选择新建全局代码片段文件,随便输入一个文件名,比如vue文件默认内容如下:{ // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. // Placeholders with the same ids are connected. // Example: // "Print to console": { // "scope": "javascript,typescript", // "prefix": "log", // "body": [ // "console.log('$1');", // "$2" // ], // "description": "Log output to console" // } }格式说明配置文件需要三部分,prefix就是触发此模板文件的命令,body是模板内容,description就是描述信息配置内容以 vue 文件为例,配置模板内容如下:"Create vue template": { "prefix": "vue", "body": [ "<template>", " <div>\n$0", " </div>", "</template>\n", "<script>", "export default {", " name: \"${1:component_name}\",", " data() {", " return {\n", " }", " }", "}", "</script>\n", "<style scoped>\n", "</style>" ], "description": "default vue template" }将上述代码复制到{}之内即可此时,新建一个 vue 文件,输入vue,按回车,会自动创建模板其他格式代码参考 vue 即可
2019年07月20日
688 阅读
0 评论
0 点赞
2019-05-10
Visual Studio Code插件koro1FileHeader使用记录
介绍VS code是一个非常方便的工具,加上免费,所以一直在使用。 本文记录一下此插件的配置过程以及配置文件,方便以后使用。作者信息插件写代码的时候会习惯性的在头部写上描述信息和作者,但是文件过多的时候就不方便手动写,修改文件之后也不方便手动修改时间。插件里面有好几个文件头部插入作者信息的插件,经过使用,此插件最方便,功能也最为完善。[github author="OBKoro1" project="koro1FileHeader"][/github]配置使用 插件安装之后需要自行添加配置文件,在VS code界面下,依次点击文件-首选项-设置,出现下图界面,点击在setting.json中编辑 在文件中,加入以下内容: "fileheader.customMade": { "Email": "rumosky@163.com", "Author": "rumosky", "Gitee": "https://gitee.com/rumosky_admin", "Date": "Do not edit", "LastEditors": "rumosky", "LastEditTime": "Do not edit" }, "fileheader.cursorMode": { "description":"", "param":"", "return":"" }, "fileheader.configObj": { "autoAdd": false, "autoAlready": true, "createFileTime": true, "timeNoDetail": false, "annotationStr": { "head": "/*", "middle": " * @", "end": " */", "use": true } } 以上配置内容作用请自行参考插件wiki 不知道为什么此插件的插入行数设置无效
2019年05月10日
2,738 阅读
0 评论
0 点赞