小代码,大错误

Posted Mike Von

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小代码,大错误相关的知识,希望对你有一定的参考价值。

第一个:Bus error

#include <stdio.h>
int main()
{
    short a ;

    scanf("%d",&a);
    printf("\\n a= %d\\n",a);

    return 0;
}

 

第二个 Illegal Instruction

#include <iostream>  
using namespace std;  
  
int main()  
{  
    string s = "123";  
    printf("xxxx is %s", s);  
}  

这里其实应该是一个Illegal instruction的错误。

 

以上是关于小代码,大错误的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段13——Vue的状态大管家

VSCode自定义代码片段13——Vue的状态大管家

VSCode自定义代码片段13——Vue的状态大管家

Android课程---Android Studio使用小技巧:提取方法代码片段

android小知识点代码片段

微信小程序代码片段分享