Ok so heres my story. Ive done basic programming before with serverside javascript which is not really used but effective when creating small backend databases and its kinda like vb script, so im familiar with basic concepts like funtions, arrays etc

Ive been reading some books on C++ and ive gotten to the poiters part and just cant get my head around it, a better way for me to learn IMO is to build a program that i find interesting, when i say interesting i mean something that i can use when im finished.

So rather than reading lots more boring (yet i realise its still essential) books on c++ id rather start making programs and when i get to a part of the program that requires pointers etc then i can read up on that section in one of the books, this for me is a much better way to learn

So ive a big interest in poker and play online alot, id like to build some programs like a calculator that recognises my hand and then tells me what are my odds of the hand improving etc

Also most poker players use programs called Holdem Manager and Poker Tracker which use a PostgreSQL database, it saves tons of info on each hand played like VPIP (what % all hands does player play) PFR (How often a player raises) etc etc etc

Obviously this will require some SQL knowledge, i know how to find the database schema and see everything inside the database but ideally id like to build a program that uses the information in the database in a program and displays information that Holdem Manager or Poker Tracker cant in real time. So i might want to see how often someone specific re-raises me preflop for example which them other programs currently dont.

So ill obviously start with a few of the examples in the FAQ and try them but i want to know, what program do you use to make a GUI, say i want to make a calculator like the windows calculator what would you use to make that application. I dont mind paying for a program if its good but if theres a good free alternative that would be better.

Also is a C++ application going to be able to extract information from the PostgreSQL database and use it in the program or should i be using another language?

Finally, when i extract the information id like to be able to display it in a moveable block, for example there will be 6 players at the table, id like to be able to have 6 blocks, 1 for each person and i can overlay it beside them on the table and it will lock the position to that table if i move it kind of thing.

The ultimate final thing, and i realise im probably getting way ahead of myself, how would i go about extracting information from the poker table, i mean reading information either from the text window that displays the cards and betting info or in the case on some sites where they dont have all the info in text is it possible to extract info from the table by some technology that can read numbers and characters in graphical format.

So i know some of the stuff is pretty techinical for a beginner but i just want to get and idea whats involved and by the time i finish i should have learned alot about C++ and SQL

Well if you dont understand pointers, you wont be able to do anything graphical or involving databases....

If you dont understand the concept of a pointer, do a project. E.g learn about inheritance and 3d arrays by writing chess, or datastructures and dynamic memory by writing your own linked list class.

But unless you are clear on a) OOP, principlally inheritance (you will be using this if you do, e.g MFC Apps) b) Pointers, then any form of GUI programming is a no-go.

Well if you dont understand pointers, you wont be able to do anything graphical or involving databases....

If you dont understand the concept of a pointer, do a project. E.g learn about inheritance and 3d arrays by writing chess, or datastructures and dynamic memory by writing your own linked list class.

But unless you are clear on a) OOP, principlally inheritance (you will be using this if you do, e.g MFC Apps) b) Pointers, then any form of GUI programming is a no-go.

Yeah what i meant is i cant get my head around what their supposed to be doing, i can understand why we use arrays but in the book examples i just cant see a good reason not to use an array instead other than they say pointers make a program run faster than using arrays.

But this is exactly what i mean, when i look at meaningless examples in the book its difficult to understand, i dont plan on not learning pointers and all the other neccessary options, but id rather learn by trying to make a program and then seeing, ok this next bit of coding would be better done with pointers, then i can see a useful example.

Id probably be much better off by starting with smaller calculator programs, ill google around for how to build a GUI calculator and once i have that down ill have a better idea of where i am, thanks for the help so far

i just cant see a good reason not to use an array instead other than they say pointers make a program run faster than using arrays.

An array IS a pointer.

An array is contiguious block of memory. Holding data of one datatype. Say, an char is a byte (not sure if it is, this is just an example). And you have an array of chars of size 3

char myarray [3] = [000000000000000000000000] in memory.
The first byte is myarray[0] and so on.

All an array is is a pointer to the first element. Becasuse it knows the datatype, it just advances it X amount for each element index.

Indeed, you can play about with that (pointer arithmetic). If you add write a loop which adds sizeof(int) to the pointer reference, you can traverse an array of ints, for example.

Its the same with strings too.. In C++ a string is a pointer to the first element in a character array. Indeed, when you change a string after definition in C++ what it has to do is delete and recreate it, as the array is a fixed size datastructure.

i dont plan on not learning pointers and all the other neccessary options

You need pointrs to do anything seeing as ultimately a cumputer works on memory locations. There are also certain situations where they are the only way to do what you want (look up pass by value vs pass by reference with relation to this)

Edited 7 Years Ago by jbennet: n/a

Another angle pokerDemon is that you are going to have to decide which is more important for you, i.e., learning C++ or learning to code some kind of poker game. If what's most important is being able to code a poker game, and C++ just happens to be the language somebody told you might be a possible choice, then maybe you ought to choose an easier language to use instead of C++. Fact is, the 'paying your dues' part is probably a lot higher in C++ than with other languages that don't even use pointers.

On the other hand, if its really important to you to learn C++ and you just used the poker thing as a possible example of something to start, then I'm afraid you are just going to have to bite the bullet and pay your dues if you want admittance.

Oh, and that thing about reading graphical numbers on your computer screen...

The graphics you see are just a rendered version of character strings that are existing in the programs data buffers. And the character strings are accessable through guess what?

Yep! You guessed it!

Pointers!

Yeah, a big motivation is doing the poker programs, ive been doing some more research and it looks like C# might be a better choice, the book ive gotten my hands on deals with learning the basics, making a graphical windows form and also interacting with the database and this covers most of what i want to do in the early stages. From first glance there dosent seem to be reference to pointers, but if there is ill learn them, ive no problem with learning them i think it was just the last book i was reading didnt explain them very well. I understand the concept of pointers just not fully or where they can be useful. Anyway thanks for all the info, i think ive enough to get me going in the right direction now

Fact is, the 'paying your dues' part is probably a lot higher in C++ than with other languages that don't even use pointers.

All languages use pointers. All computers know is memory locations.
. Higher level languages just hide them from you.

The graphics you see are just a rendered version of character strings that are existing in the programs data buffers

characters are integers representing an encoded value. Thats why if you cast to an int and +1 to a char of A you get B because A is 65 in its decimal ASCII representation of A and B is 66.

I understand the concept of pointers just not fully or where they can be useful

Do you know what a linked list is? Look that up, its a prime use for them.

This article has been dead for over six months. Start a new discussion instead.