关于C++template

学术版

MornStar @ 2024-06-13 13:10:12

#include<bits/stdc++.h>
using namespace std;
const int NMAX=550005;
template<typename T,int N> struct name{
    T t[N];
};
int main(){
    name<int,NMAX> T;
}

NMAX 在500000的时候可以运行,但是开大过后本机上就RE了。这是什么原因


by Phartial @ 2024-06-13 13:14:27

是不是栈空间开小了导致的


by xxxxxzy @ 2024-06-13 15:36:49

@MornStar 要开无限栈


by Crab_Tang @ 2024-06-14 21:27:18

@C20252323tzy @bykem 咋开


|