• Advertisement

sniffbaron

Member
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

100 Neutral

About sniffbaron

  • Rank
    Newbie
  1. c++ unresolved external symbol help

    Thx alot, now it works perfectly :-)
  2. c++ unresolved external symbol help

    Hi again. The book did tell me how to set up the project, and I do infact have a basic understanding of c++ I'll double check that i'v done everything right (again) and see if I can get it working. It may be because the examples of the book are for the 2008 version of visual c++, while I have the 2010 version. Would this be an issue?
  3. c++ unresolved external symbol help

    Hi again. I reading the book "Beginning game programming" by Jonathan S. Harbour, and I just followed the instructions of the book. It is supposed to be a win32 project and it worked for the author. here is the code [code] // Beginning Game Programming, Third Edition // Chapter 1 - HelloWorld program #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MessageBox(NULL, "Motoko Kusanagi has hacked your system!", "Public Security Section 9", MB_OK | MB_ICONEXCLAMATION); } [/code]
  4. Hi, I am trying to learn myself c++, but I have run into some issues. When I try to compile a program in visual c++ express I get the error 1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------ 1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup 1>c:\users\jonas\documents\visual studio 2010\Projects\HelloWorld\Debug\HelloWorld.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Hope sombody have some ideas of what to do
  5. c++ Infinate loop help

    Thank you. I'll se if I can get it working now
  6. c++ Infinate loop help

    Thx for the help, don't know why I had the "answer" variable at all. But what should I do to make this work? And if you red the introduction at the start of this thread you would see that the point of this game is that you pick a number and the computer guesses it. Just somthng I wantet to try out
  7. c++ Infinate loop help

    Thx, but it's still not working properly [code] else { answer = randnumber; cout << "The number is " << randnumber << ". I made it in " << tries << " tries"; } [/code]
  8. c++ Infinate loop help

    Hi. I just tried making a program that let's you pick a number and then the computer will find it, but I'm getting stuck in an infinate loop and I need some help. [code] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int maxnumber = 100; int minnumber = 1; int number; int tries = 0; int answer; srand(static_cast<unsigned int>(time(0))); int randnumber = rand() & maxnumber + minnumber; cout << "Pick a number\n"; cin >> number; do{ int randnumber = rand() & maxnumber + minnumber; if(randnumber > number){ cout << randnumber << endl; maxnumber = randnumber; ++tries; } else if(randnumber < number){ cout << randnumber << endl; minnumber = randnumber; ++tries; } else { randnumber = answer; cout << "The number is " << randnumber << ". I made it in " << tries << " tries"; } }while(answer != number); system ("pause"); return 0; } [/code]
  • Advertisement