Search:
Type: Posts; User: raptor88
Search:
Search took 0.05 seconds.
-
December 12th, 2012, 10:58 PM
Thanks for your info.
Raptor
-
December 11th, 2012, 06:33 PM
Thanks for that clarification.
Raptor
-
December 10th, 2012, 07:10 PM
Hi Paul,
Could you explain the difference between using "extern" on a function verses a global function?
Say I create two files named Globals.h and Globals.cpp.
I code a function in...
-
December 3rd, 2012, 08:02 PM
Scratch this question. I found that VS "Express" 2012 is free. I was probably looking at the non Express version before.
Answers for the other questions still needed though.
Thanks,
Raptor
-
December 3rd, 2012, 06:27 PM
The "Windows 8 compatibility assistant" says that Visual C++ 2010 Express installed in my Vista laptop is not compatible with Windows 8 Pro. However, I've learned that many programs that Win8's...
-
December 2nd, 2012, 07:15 PM
AH HA MOMENT!
I can see now that when the vector of structs is instantiated, space for the string is not allocated "within" the struct. Just a pointer to the string is the actual member in the...
-
December 2nd, 2012, 03:20 PM
This is what I'm trying to understand. How is the sizeof(MyStruct) the same for every struct when there is a variable length string in the struct? Without a variable length member in the struct...
-
December 2nd, 2012, 02:19 PM
Totally right. Being new to C++, I used the parenthesis for "myVect(8)" in my actual test code but used the [] in my example here. Thanks for catching that.
My understanding is that a vector...
-
December 1st, 2012, 03:07 PM
A new question regarding vectors and iterators.
I declared a struct that contains integers and one string. Then I instantiated a vector to hold the structs and set the total number of structs. ...
-
November 30th, 2012, 04:38 PM
I wrote a test program and yes, pre-increment doesn't skip the first element. Goggling shows that a for loop works like a while loop with the increment occurring at the end of the loop. Also...
-
November 29th, 2012, 05:11 PM
Understand. Going back to your previous post, why is pre-increment faster than post-increment? And won't pre-increment skip the first element in the for loop?
Thanks,
Raptor
-
November 29th, 2012, 05:03 PM
Actually no, I'm not preferring method-3 because of less typing. Method-2 uses "vector<int>::size_type" in place of Method-3's "unsigned" which is not that much more typing.
Method 2:
for...
-
November 29th, 2012, 06:43 AM
I put my question in that form to simplify what I was trying to ask. My basic question was whether Method-3 should always work under the conditions I set. Just trying to understand how vector...
-
November 28th, 2012, 11:32 PM
C++ beginner learning how to use vectors.
I see that there are 3 ways to iterate through a vector.
Method 1:
for(vector<int>::iterator it = myVect.begin(); it != myVect.end(); it++)
...
-
October 22nd, 2012, 02:20 AM
My bad Paul. In hindsight I can see why you think my plan is to code most everything using globals and not using classes. The code I posted was just extending your example to verify whether my...
-
October 21st, 2012, 03:51 PM
Would that be moving the enum statement before the struct statement?
Since I need to access the betInfoMap[4] in my "GetBets", "PayBets" and on every iteration of the crap table drawing routine...
-
October 21st, 2012, 06:38 AM
Is this the correct way to use Paul's code of the map of structs in an array for 4 players?
#include "stdafx.h"
#include <string>
#include <iostream>
#include <map>
using namespace std;
-
October 18th, 2012, 08:30 PM
Thanks for clearing that up Paul. Learned a lot from this thread. I did plan to only use your method in the future since it's easier to type but now I know it also works better.
Thanks,
Raptor
-
October 18th, 2012, 03:30 PM
Guess I need to do more research since I really don't understand why the code I showed works different from Pauls. Thanks for pointing that out.
-
October 18th, 2012, 01:55 PM
For other beginning C++ learners, here's a substitute for Paul's struct code. Tested and it works identically.
// The following code is equivalent to Paul's struct code and it works...
-
October 18th, 2012, 01:48 PM
Yes, I did realize that but failed to say that "structs are like classes except they are always public by default". Thanks for clarifying it just in case I didn't realize it.
Yes, once one...
-
October 18th, 2012, 12:54 PM
Hi Paul,
Thank you very much for taking the time to explain your code. Who would have guessed that even structs can have constructors. C++ books and web tutorials are so simplistic that they...
-
October 18th, 2012, 12:36 PM
OK, am more than willing to buy another C++ book. Please tell me the name of a book that explains what Paul did with his constructor statement within a struct. None of my 6 or 7 C++ books nor hours...
-
October 18th, 2012, 05:30 AM
Hi Paul,
Going over your code, that's an extremely clever method of setting up the structure so it can be initialized in the format you show in main. I Googled for over 2 hours and could never...
-
October 17th, 2012, 06:31 PM
That is really helpful Paul. I'll try to figure out how to use that for 4 players. Maybe an array to hold the maps.
Thanks!
Raptor
|
Click Here to Expand Forum to Full Width
|