<split from http://cboard.cprogramming.com/showthread.php?t=7988; thread bumps, particularly from six years ago, are best avoided ~ken fitlike>
hey guys i need some help with a battleship program, im not too sure how to do it..
basically it needs to have a 15 by 15 grid,
i dont expect any1 to do a full code for me but i just need some help gting started..
This code cannot compile if a function does not specify return type.
May I plug my little battleship game? You may get some ideas from it. The way I input locations is I assume that it's input the right way, use atoi (hey, I wrote it a while ago) and check the resulting data. If they type in something about a teapot then they get to try again until they get it.
Well, I'm certainly not going to evaluate all the code, but an interesting (or dangerous thing) is that you use scanf incorrectly to read strings. Read my signature from the proper way (or use fgets!).
And rather than atoi, it's preferable to use strtol. But it's optional.
Heh, I never knew that. But then again I'm sure that a decent programmer could dissect all my code and find all sorts of worst practices that i use. I've got a lot to learn, but I'm all self taught.
Originally Posted by Elysia