gpt4 book ai didi

c++ - stringstream 未在此范围内声明

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:00:53 27 4
gpt4 key购买 nike

我在使用 stringstream 时遇到问题。我的 visual studio 和 linux g++ 都无法理解 stingstream。我已经添加了 sstream 但它没有解决任何问题。我以前用过它,但真的不知道它现在怎么样了?

#include <sstream>
#include <stdlib.h>
#include "SymbolTable.cpp"
#include "setjmp.h"
using namespace std;
jmp_buf *bfj;
int TOP , SP=3 ;
struct types{int int_val;float float_val;char char_val;bool bool_val;};

types DS[6400];
int main(){
...//some code here
label38 : stringstream s;
label39 : bfj = (jmp_buf *)"label65";
label40 : longjmp(*bfj,1);;
label41 : goto label43;
label42 : TOP=SP;
//some code here
}

我正在编写一个编译器,所以代码就是输出,这就是为什么它的接缝可能有点奇怪。

最佳答案

如果您包括 #include <sstream>那么您还必须通过以下方式引用该类:

std::stringstream或声明 using namespace std;在使用之前。

如果您发布更多信息,我们可以提供更详细的帮助。

关于c++ - stringstream 未在此范围内声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3086949/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com