小代码,大错误

第一个:Bus error

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

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

    return 0;
}

第二个 Illegal Instruction

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

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

原文地址:https://www.cnblogs.com/crazyghostvon/p/bigIssue.html