c/c++
c或者c++学习过程中的一些小笔记
日出前的千夜
半路出家小萌新
展开
-
STL priority_queue 优先级设置 基本数据类型&结构体
#include <stdio.h>#include <queue>#include <string>#include <iostream>using namespace std;struct fruit{ string name; double price; friend bool operator <(fruit f1,fruit f2){ /*要定义结构体的比较方法,需要重新定义小于符号。(只需要定义小原创 2021-02-07 17:50:58 · 183 阅读 · 0 评论 -
c语言 error: stray‘\243‘in program error: stray ‘\254‘ in program
c语言编译时出现如下问题,是因为出现了不标准的ASCII字符。一般是程序中出现了中文符号。原创 2021-01-22 16:19:08 · 5551 阅读 · 0 评论 -
c++ error: unable to find numeric literal operator ‘operator““n‘|
代码:#include <stdio.h>int main(){ int n; scanf("%d",&n); int cnt=0; while(n!=1){ if(n%2==0) n/=2; else n=(3n+1)/2; cnt++; } printf("%d",cnt); return 0;}出现这个报错一开始很疑惑,后来发现应该写成else n=(3*n+1)/原创 2021-01-20 21:57:14 · 9031 阅读 · 0 评论 -
c语言 process exited with return value 3221225477
3221225477 (0xC0000005): 访问越界,一般是读或写了野指针指向的内存3221225725 (0xC00000FD): 堆栈溢出,一般是无穷递归造成的3221225620 (0xC0000094): 除0错误,一般发生在整型数据除了0的时候原创 2020-06-26 19:11:39 · 30026 阅读 · 3 评论