a very simple c++ question# Programming - 葵花宝典
s*n
1 楼
Both try1.cpp and try2.cpp can be complied, but only try1.cpp works. when I
run try2.cpp, I always got "Segmentation fault". So what is wrong with try2
.cpp? why I can't use ifstream pointer? Thank you!
try1.cpp
#include
#include
#include
using namespace std;
int main()
{
ifstream gains("coeff.txt");
if (!gains.is_open())
{
cout<}
else{
cout<}
return
run try2.cpp, I always got "Segmentation fault". So what is wrong with try2
.cpp? why I can't use ifstream pointer? Thank you!
try1.cpp
#include
#include
#include
using namespace std;
int main()
{
ifstream gains("coeff.txt");
if (!gains.is_open())
{
cout<}
else{
cout<}
return