Forum

> > Off Topic > C++ Tutorial
Forums overviewOff Topic overviewLog in to reply

English C++ Tutorial

128 replies
Page
To the start Previous 1 2 3 4 5 6 7 Next To the start

old Re: C++ Tutorial

archmage
User Off Offline

Quote
I can't fix this I get an error about the functions in (class) clock being defined.

clock.h
More >


ClockClass.cpp
More >


main.cpp
More >
edited 6×, last 11.09.10 01:19:09 am

old Re: C++ Tutorial

Flacko
User Off Offline

Quote
In main.cpp you have to include the header file NOT the .cpp file.

It would be also a good idea if you named your headers and it's corresponding .cpp with the same name (ex: clock.h and clock.cpp)

Moreover, some programmers (like me) use to name their classes starting with a C. ex(CClock, CCar, CPlayer) this way you can declare something like CClock clock;

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Does anyone have any knowledge on Qt 4? I have it and created a dialog to get user input, but I need when the user clicked the cancel button the dialog closes.

CTextInputBox.h
More >


CTextInputBox.cpp
More >


main.cpp
More >


Btw Qt is awesome. Much better than Win 32 API. I can write an app within a few lines with Qt would take at least 80. Plus I can easily create dialogs with the editor or use it to learn how to implement things.
edited 1×, last 16.09.10 05:31:46 am

old Re: C++ Tutorial

archmage
User Off Offline

Quote
I have a question about Allegro. I installed it, but I get an error. It says
Quote
1>c:\allegro\include\allegro\internal\alconfig.h(36): fatal error C1083: Cannot open include file: 'allegro/platform/alplatf.h': No such file or directory


I could fix, but I do not know where to ut that directory I tried the include dir but it did not work.

old Re: C++ Tutorial

Flacko
User Off Offline

Quote
In my Dev-C++ it looks like
Dev/Include/Allegro/inline
Dev/Include/Allegro/internal
Dev/Include/Allegro/platform

You can edit the allegro.h if you're still having problems. But idk what you mean anyways

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Alright I will see if that works. I found that my alconfig.h was alconfig.h.cmake it also had "#cmakedefine" I replaced it with "#define" it loaded but now I am missing something else.

Edit
I am missing pc.h do you have that?

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Well I got it from their home page. I think I will use SDL I got it to compile with no problems.

old Re: C++ Tutorial

Patasuss
User Off Offline

Quote
I heard that SDL is pretty fast, but i think when you want to do simple things simple you should use the Allegro-library OR you use SDL with OpenGL. OpenGL features hardware acceleration (i think).

Now you have to decide:
SDL: fast but NOT simple (from my point of view)
Allegro: simple (from my point of view) but not as fast as SDL
OpenGL & SDL: fast,NOT simple, many features

And the pc.h is not a Allegro-Header

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Alright I have tried SFML and SDL. I want to learn SDL. Does anyone know a good tutorial? And perhaps a command reference?

Also I have a quick question:
When suffixing a number with f or F it is similar to suffixing with L or l as l or L tells it that the number is long so f or F would be float correct? It is optional for identifiers, but what about constants?

old Re: C++ Tutorial

Flacko
User Off Offline

Quote
Suffixing an l makes a number a long, a d makes it double, an f makes it a float.
With constants it's the same, including #defines.

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Alright. I found a good tutorial, but I have a question. I created a window and it was unmovable and all the header buttons (close, minimize) they were inactive. Then it crashed. Is there something wrong in my code?

Nvm I fixed it.
Edit
This is my code
More >


It runs but causes an error:
"A buffer overrun has occurred in SFMLTest05.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."
edited 2×, last 24.09.10 04:16:01 am

old Re: C++ Tutorial

Flacko
User Off Offline

Quote
No idea :S
Did you try any other compiler besides Microsoft's?

old Re: C++ Tutorial

archmage
User Off Offline

Quote
I got SFML to work. Is there a command similar to Blitz's LoadAnimImage function/
edited 6×, last 29.09.10 05:03:20 am

old Re: C++ Tutorial

stealth
User Off Offline

Quote
You can load the complete image and set the area which you want to be drawn with:

Sprite.SetSubRect(sf::IntRect(10, 10, 20, 20));

old Re: C++ Tutorial

archmage
User Off Offline

Quote
Thank you I saw that in the tut, but I skipped for some reason.

Edit:
Is there a way to iterate through each instance of a class? Or will have have to use dynamic memory or a vector to do this?
edited 1×, last 30.09.10 01:35:20 am
To the start Previous 1 2 3 4 5 6 7 Next To the start
Log in to replyOff Topic overviewForums overview