小编boy*_*712的帖子

"程序收到信号SIGSEGV,分段错误.在??()()"在Code :: Blocks中调试我的C++项目时

先在这里发帖 我正在做大学任务,我需要完成一个模拟合同桥牌游戏开标的程序.我提供了以下包含main函数的文件:

/// File: bridge.cpp
/// Creates a deck of cards, shuffles them and displays them.

#include <iostream>
#include <iomanip>
#include <fstream>
#include "game.h"

const int NUM_DEALS = 4;

using namespace std;

int main(int argc, char *argv[]) {

   Game game;
   ifstream infile;
   bool fromFile = false;

   if (argc == 2) {

      // open the file and check it exists
      infile.open(argv[1]);
      if (infile.fail()) {
         cerr <<  "Error: Could not find file" << endl;
         return 1;
      }
      fromFile = true;
   }

   for …
Run Code Online (Sandbox Code Playgroud)

c++ codeblocks

6
推荐指数
1
解决办法
6万
查看次数

标签 统计

c++ ×1

codeblocks ×1