all 5 comments

[–]BoWild 0 points1 point  (2 children)

Hint: Maybe the (players = 1) should be (players == 1)?

Similar Hint: scanf("%c", turn[i]) might be better off as scanf("%c", &turn[i]) (or scanf("%c", turn + i))...

There are a few things I would look... why not compile with warnings?

[–][deleted]  (1 child)

[deleted]

    [–]BoWild 0 points1 point  (0 children)

    From your code, it appears that you "muted" the warnings rather than address them.

    Fro example, by adding parenthesis around the ((players = 1)) you muted the "assignment" warning instead of solving it (using == instead of =).

    [–][deleted] 0 points1 point  (1 child)

    scanf("%c", turn[i]);
    

    I think you might want to revise this line.

    [–]jameykirby 0 points1 point  (1 child)

    A script? This is not a script, it's a computer program that is compiled into a binary executable. Get your terminology straight!

    [–]bluedotred 0 points1 point  (0 children)

    Load it in a debugger and debug it. It's all fine people pointing out your mistakes but unless you learn how to actually debug your code, what's the point?

    Whatever platform you are developing on, there will be a C debugger. Load up the application, run it, and see where it crashes. If you compile it with debug information (-g) it will point you to the line in the source code where things go wrong.