首页 文章
  • -2 votes
     answers
     views

    C Hangman程序调试辅助(中止陷阱:6错误)[暂停]

    我正在用C创建典型的hangman程序,代码编译并运行完美,直到我添加3行代码(25-29),在用户选择了他们想要的游戏模式后将字符串加载到结构中 . 在运行程序时,除非用户在第25-29行中执行“if”语句的选择(标识此语句的注释),否则一切都会起作用,然后终端返回“Abort trap:6”错误 . 经过研究并尝试调试我的代码,我无法找到我写入内存的地方,我还没有初始化 . 代码中的其他所有工...
  • 3 votes
     answers
     views

    中止陷阱6用于在Mac上工作c程序

    所以我编写了这个程序(源代码:http://pastebin.com/kb3QedMw),它基本上是一个状态机(用c实现),它读取日志文件,然后计算一些平均值 . 据我所知,它运行平稳,输出正确 . 但是,如果使用clang 3.3在Mac上编译,我会在程序的最后收到一条消息"Abort Trap 6"(在返回0之前或之后,据我所知) . 在一台带有clang 3.4的linu...
  • 17 votes
     answers
     views

    C中止陷阱6错误

    我有这个代码: void drawInitialNim(int num1, int num2, int num3) { int board[2][50]; //make an array with 3 columns int i; // i, j, k are loop counters int j; int k; for(i=0;i<num1+1;...
  • 4 votes
     answers
     views

    中止陷阱:C程序中的6个

    我在C中有一个程序 . 它编译成功并且运行正常但是在 main() 结束时,它崩溃了并且给了我一个 Abort trap: 6 错误 . 我对如何调试这个没有丝毫的线索 . 关于SO与 Abort trap: 6 错误有关的几个问题对我没什么帮助 . 一般来说,可能是什么问题? (我现在不愿意发布我的源代码,因为它大约有400行代码 . 如果我知道要查找什么,我会发布一段特定的代码 . ) 注意:...
  • 0 votes
     answers
     views

    “Abort trap:6”在Mac上运行C程序

    我有这个程序的问题 . 当我尝试在Mac上运行它时,它会返回“Abort trap:6” . 我无法理解原因 . 下面是我用来测试程序的文件内容 . aaabccdegags bbbbbbbcados vbaiusbyabtd aisybavsitvc asindvsivati ammaccabanan 您应该将这些无意义的字符串复制到文本文件 file.txt 中,并使用以下语法通过命令提示...
  • 1 votes
     answers
     views

    C和调试中的Abort Trap 6错误

    嘿伙计们已完成我的代码,当我尝试运行时,我收到“中止陷阱6”错误 . 我不知道这个错误是什么,以及如何找出我的代码破坏的地方 . 对c来说比较新,所以谢谢你和我一起玩 . 这是我的代码: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #def...
  • 92 votes
     answers
     views

    Xcode 8 cocoapods中止陷阱:6

    localhost:PodTest3 haiwang$ pod install Analyzing dependencies Downloading dependencies Installing MBProgressHUD (0.9.2) Installing Masonry (1.0.2) Generating Pods project Abort trap: 6 升级到Xcode 8后, ...
  • 17 votes
     answers
     views

    C中止陷阱6错误

    我有这个代码: void drawInitialNim(int num1, int num2, int num3) { int board[2][50]; //make an array with 3 columns int i; // i, j, k are loop counters int j; int k; for(i=0;i<num1+1;...
  • -2 votes
     answers
     views

    中止陷阱:strncat()出错6次

    我正在尝试编写代码,我必须实现库函数strncpy,strncat和strncmp的版本,但它给了我Abort trap:运行时出错6 . 任何想法都非常感谢: #include<stdio.h> #include<string.h> int main() { char str1[400]; printf ("Enter the first...

热门问题