我想创建一个存储数据类型名称的向量(int,char,bool等)
我正在寻找类似的东西:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc,char** argv)
{
vector<typenames> v = {int,float,double,bool};
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在Linux上编译以下C代码:
#include <stdio.h>
/////
void func1();
void func2();
//////
void func1()
{
func2();
}
void func2()
{
func1();
}
int main()
{
func1();//call to function 1
}
Run Code Online (Sandbox Code Playgroud)
如果我没有记错的话,该程序应该无限执行,但是当我在Linux上编译并运行它时,就会出现Segmentation Fault。为什么会这样呢?