• 0

Programming help!


Question

Hey guys, posted this in the newbie section, but technically i`m not a newbie!

"Hey guys, i need some BIG help.

Its the last 2 weeks of my computing course at college and i am panicking over my program, the tutor isn't allowed to help me with the program all he can do is say whether its wrong or right and what i need to do next etc.

Anyways, i have the program half done at least, but now i am completely stumped, i was wondering if someone here could add me on msn and help me finish the program, i wouldn't bother asking but i suck at it and its not my strong side not to mention its a required credit to pass HNC computing! "

Link to comment
Share on other sites

Recommended Posts

  • 0
That's cause it's cause it's caught in an infinite loop. The function gotoxy is defined as GotoXY but GotoXY calls gotoxy which is basically calling itself.

Exactly :wacko:

EDIT: I think gotoxy is a c++ function (I think someone mentioned that earlier in the thread; I may be mistaken) but he is making a gotoxy called GoToXY, so it's alright (since cpp is case sensitive).

Link to comment
Share on other sites

  • 0

I was talking about this line:

#define gotoxy GotoXY

That line tells the compiler to replace every appearance of "gotoxy" in the code with "GotoXY". So in essence the function GotoXY is equivalent to

void GotoXY (int x, int y) {
	GotoXY (x-1,y-1);
}

Just delete that #define statement. :p

Link to comment
Share on other sites

  • 0
I was talking about this line:

#define gotoxy GotoXY

That line tells the compiler to replace every appearance of "gotoxy" in the code with "GotoXY". So in essence the function GotoXY is equivalent to

void GotoXY (int x, int y) {
	GotoXY (x-1,y-1);
}

Just delete that #define statement. :p

That would be true if the #define was located before the function definition. But it's located after the function definition, so it's just fine. Well, okay, it depends on how the preprocessor behaves, but it should not be applying the #define to anything located before it.

Link to comment
Share on other sites

  • 0
At this point you should write your documentation and just comment in your plans for any unfinished work..

Yeah, it just crashes after i chose a sub menu, and i only just realised ive forgotten to add search by name and search by cutomer number etc.

:-(

Link to comment
Share on other sites

  • 0

Well comment in what you would do if you had time, and make sure you have properly commented everything else. You will get a good amount of credit for the work you've already done I'm sure.

I'm assuming the documentation is worth a significant portion of marks, in which case, get it written. It makes more sense to focus your last hours before the deadline on stuff you know you can do and get marks for, rather than debugging and possibly getting nowhere.

Edit: people already mentioned deleting that define line -> just try it, see if it helps. If it makes no difference, put it back. You can't expect to successfully write programs without compiling and testing every new piece of code you add to it..

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.