Hello fellow coders.
I have recently taken an interest in programming after seeing some simple management games made with c++.
I am trying to create a simple windows form application in visual studio 2008 which when I click my button, it displays a random number between 1-10 on screen.
Now there seem to be alot of tutorials on how to do this, but they are all different methods acheiving the same result. Also they all use the console panel for the output. I however want a tutorial that will get my program working in the form I have created.
I am not sure where I am supposed to enter the code either, as again, the tutorials I am watching use c# or vb for the windows form application, and the c++ uses the console.
Can I put this console code into the form somehow.
Sorry for my confusing post, but I am just lost here.
If you're new to C++, then I'd recommend you avoid doing anything involving Windows forms or GUI applications just yet.
The standard C++ language is not specific to Microsoft Windows and there is no standard way to create a GUI - this is why you'll have found plenty of different ways to do it, because everyone does it slightly differently. In fact, there are multiple libraries available too (for example, MFC, QT, WxWidgets, GTK, just to name a few). your first task will be to pick one of those libraries before you start creating Windows forms. Visual Studio uses MFC, but MFC is a rather old technology which people tend to avoid these days (QT and WxWidgets are more popular)
If your interest is in learning C++, then I'd suggest sticking to the console until you feel competent at using the language - you'll have an easier time without needing to learn all the various quirks of a GUI library at the same time (GUIs are not "easy" in any general-purpose programming language - not even in VB or C#, but especially not in C++)
If your interest is in creating GUI applications for Windows, then you might have an easier time using C# instead. The main difference being that the .NET framework has some very simple and powerful technologies which exist for the sole purpose of creating Windows applications. You'll still be better off learning the basics on a console window however.
C++ on the other hand is a general-purpose programming language which is designed to support programming on any kind of system - including those where there is no such thing as a "Screen" or a "Mouse".
If you want to make GUI programs, type Codelite into Google and download it, when you install it, include wxWidgets, use that to make GUI programs. But I would recommend learning some basic C++ before doing that. wxWidgets is one of the simplest