Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
64% Quality Score
Upvotes Received
7
Posts with Upvotes
7
Upvoting Members
5
Downvotes Received
4
Posts with Downvotes
3
Downvoting Members
4
5 Commented Posts
~34.5K People Reached
Favorite Tags

98 Posted Topics

Member Avatar for MasterGberry

Title may be a bit off, but I am having issues trying to form this last function. I created a simple sorting algorithm for a list of ints I have for a project, now the ints are from the min to max. I know the size and have a pointer …

Member Avatar for mrnutty
0
199
Member Avatar for MasterGberry

So this is a topic asking for a good explanation if possible rather than code fixes :) So I had this code which originally took two parameters of pointer type and then I changed it to pointer references (or reference pointers?) (tell me which one it is) and it started …

0
50
Member Avatar for MasterGberry

I am supposed to make a binary hash tree mix of code. I know what I am doing for the most part, but its been a while since I have done some serious C++ coding. The compiler is yelling at me because it doesn't like my last definition in my …

Member Avatar for MasterGberry
1
186
Member Avatar for MasterGberry

Having some problems figuring out how to do this... Basically I have the following right now: [code] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^Age-Of-Empires-Online/([^/]*)$ /index.php?portal=AOEO&$1 [/code] I need to make the old URLs re-direct to the new URL format...but I still want the new URL to ACT like the …

Member Avatar for sDJh
0
106
Member Avatar for MasterGberry

In a few URLs I have on my website, they feed a parameter into the URL that sometimes contains [] in it. I have a preg_replace fixing some links, but the [] breaks my current system. How can i make this work? (I need it in the second half, for …

Member Avatar for pritaeas
0
176
Member Avatar for MasterGberry

So I am operating a website using the PHP Invision Power Board system, and it's kind of old. There are 10,000s of lines of code in it that are custom, and re-writing the website is probably more work then its worth at the moment. I want to take the URLs …

Member Avatar for pdhanunjaya
0
124
Member Avatar for MasterGberry

So i am a very fluent C++ programmer, and am switching over to PHP/Javascript/MYSQL for some new work that I am doing. I know all the basics of C++ and some of the more advanced STL libraries. I know very basic PHP simply cuz I already know all the arrays, …

Member Avatar for chrishea
0
541
Member Avatar for MasterGberry

Made a small project to help compare two files that I am testing...but for some reason the line I highlighted isn't working as its supposed to. I originally had [CODE]c1 != c2[/CODE] and then changed it to [CODE]!strcmp(c1, c2)[/CODE] Maybe its a dumb logic bug, but would appreciate some help …

Member Avatar for WaltP
0
113
Member Avatar for MasterGberry

Ok, somewhat easy task, but i dont know how to do it. Basically i need to take a currenty written dll file ( which i dont hae the source code for) and i need to copy all of the original content and i need to import some functions from another …

Member Avatar for thekashyap
0
2K
Member Avatar for MasterGberry

I am disassembling an exe file trying to find out how some parts of it work so we can make an easier modification then the current system works (which is just copy and overwriting files). I found some functions in there that refer to a MPGameSetupPage.cpp (which obv i can't …

Member Avatar for VernonDozier
0
180
Member Avatar for MasterGberry

I am taking on a new project, this one should be a lot smaller than the previous. I want to take an exe file (a game executable), and change the memory addresses that it reads files from in memory. For instance, when you run the game executable it opens a …

Member Avatar for MasterGberry
0
372
Member Avatar for DaniwebOS

You never set the reference that you passed. It should be this instead [CODE]//all functions void studentName(string &studName) { cout <<"Enter student's name: "; cin.ignore(); getline(cin, studName); // you want to set this value that you are passing to the function as a reference }[/CODE]

Member Avatar for jonsca
0
126
Member Avatar for MasterGberry

I am interested in learning how to make a simple tic-tac-toe game playable on 2 computers. A small simple project that can help me learn some network coding. I can't seem to pin down a good reference for it. Where is a good place for me to read up on …

Member Avatar for MasterGberry
0
82
Member Avatar for aaronmk2
Member Avatar for plang007
Member Avatar for plang007
0
631
Member Avatar for Jaily

If the Do-While Loop is not ending then it is because it is not being given a value to make it quit. [CODE] iResult = recv(ClientSocket, recvbuf, recvbuflen, 0);[/CODE] What is the code for this?

Member Avatar for tundra010
0
108
Member Avatar for MaDo4

I don't see why you would be calculating the average until BOTH for loops end, that would defeat the purpose. you could do [CODE]int i, j; // define variables here so they are in the scope and can be used for average for(i=0; i<SIZE; i++){ for(j=0; j<SIZE; j++){ total = …

Member Avatar for MaDo4
0
143
Member Avatar for aarahi
Member Avatar for MaDo4

I did this....simple but works [CODE]int main() { char c1, c2; c1 = getchar(); // get first input c2 = getchar(); // get second input if (c1 == '\n' && c2 == '\n') // if post inputs are enter exit(1); // exit }[/CODE]

Member Avatar for MaDo4
0
2K
Member Avatar for MasterGberry

I have been looking into an internship through Google, i have a good basic background, but I need more knowledge, I read C++ Primer Plus 5th Edition and got a good background from it. Where can I continue to expand my knowledge? I am trying to nail a phone interview …

Member Avatar for mike_2000_17
0
117
Member Avatar for MasterGberry

I read something online about being able to make my patch run as an administrator by default by using XML code? How would i put this into my program? This patcher is going to be put into a larger source code of a client, and will just be called by …

Member Avatar for MasterGberry
0
60
Member Avatar for Szeth

Quick suggestion, running out the door so i can't give a more detailed explanation. Look into CCTYPE Header. It has functions built in that should help you. If one of the functions returns false then use exit(EXIT_FAILURE) from the <cstdlib> header.

Member Avatar for Szeth
0
381
Member Avatar for danijela123

Here is an example that I used in my recent binary project use sizeof(dataCount) instead of sizeof(char) because it depends on the compiler, although 2 and 4 are the standard. Also using signed int garuntees that you can get negative values, your code looks fine though. [CODE]inFileDrs.read(reinterpret_cast<char*>(&tableCount),sizeof(tableCount));[/CODE]

Member Avatar for MasterGberry
0
119
Member Avatar for MasterGberry

I have a pretty solid background on C++. I am interested in possibly expanding to new languages such as Java. I am not interested in reading another 1000 page book on a language when i read that C++ and Java are somewhat compatible. I also read a lot of the …

Member Avatar for DarkLightning7
0
164
Member Avatar for MasterGberry

Ok. So this patch i made has been in beta testing. For some reason my C++ version does not always write the files. but it shows that it patched sucessfully......lists the correct directory where it should be writing the files. They just dont show up. The c# version works though …

Member Avatar for MasterGberry
0
281
Member Avatar for mespo365

I believe what you are looking for is the [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/"]Atoi[/URL] function. Here is a quick example [CODE]#include <iostream> #include <string> // used for string support #include <stdlib.h> // used for atoi() support using namespace std; int main() { string theString = "12345"; // the string we are going to convert …

Member Avatar for jonsca
0
173
Member Avatar for MasterGberry

Haven't worked with classes for a while, so please excuse all these dumb questions :P Still learning. Let me know if you need more info. 1>c:\users\adam\documents\visual studio 2010\projects\help\pusoy\pusoy\pusoy.cpp(24): error C3867: 'Deck::dealCard': function call missing argument list; use '&Deck::dealCard' to create a pointer to member deck[] is a vector of Card …

Member Avatar for MasterGberry
0
189
Member Avatar for MasterGberry

I took my deck of Cards (class Card) and shuffled the. But every time i ran the program it gave me the same shuffled results.... [CODE]void Deck::shuffleDeck() { std::random_shuffle(deck.begin(), deck.end()); }[/CODE]

Member Avatar for erikandr
0
130
Member Avatar for MasterGberry

I am trying to take a std::vector<Card> and organize it by one of the int values stored inside the Card class. How could I go about doing this with iterators and the sort() method? Or is it not possible? Ty :)

Member Avatar for MasterGberry
0
101
Member Avatar for MasterGberry

I am making a simple card game, trying to shuffle a deck of cards that i made with a map. [CODE]std::map<int, std::string> theDeck;[/CODE] How could I go about shuffling the items in the deck? I am having issues figuring out the algorithm. This is what I tried, but didn't work. …

Member Avatar for MasterGberry
0
1K
Member Avatar for MasterGberry

I am trying to write a simple Batch File to launch an exe using some basic CMD PRMPT functions. I know exactly what I need to do, but my only problem is I don't know how to detect the Desktop Folder? What if its in Documents and Settings, or if …

Member Avatar for MasterGberry
0
2K
Member Avatar for MasterGberry

Ok, well I have done some research on this. And I have tried a few different methods, both seem to be giving me the same results, which must mean there is something else going on here that I am not understanding, or its just not working right. EDIT: This piece …

Member Avatar for MasterGberry
0
204
Member Avatar for MasterGberry

I am getting the correct chars when i read each individually such as data.at(0), (1)...etc. But when I am trying to read them into variables, i am getting some weird values for some of these. For instance: Getting value of 3, i should be getting the value of 1311780402 Also …

Member Avatar for MasterGberry
0
508
Member Avatar for MasterGberry

Ok, so i don't think I need to post all the code....most of you have seen a lot of it anyways, if I need to I don't mind. But anyways, I made the outFileDrs Stream, then at the end of the program it closes it. But its only 1 kb? …

Member Avatar for MasterGberry
0
133
Member Avatar for MasterGberry

I am trying to do the following in C++, the C# code is here test is a string btw. [CODE]if (test == null || !test.Equals("Item Name\t")) return data;[/CODE] I did this in C++, but its crashing the program [CODE] if (test.compare(NULL) == 0 || test.compare("Item Name\t") != 0) return data;[/CODE]

Member Avatar for MasterGberry
0
649
Member Avatar for MasterGberry

This loop is going slow because of the push_back part at the end, can i make this go any faster? Basically this is what it does 1) Reads file into a char array 2) takes each char in the array and transfers to vector. [CODE]char *tempItem = new char[1]; delete …

Member Avatar for MasterGberry
0
152
Member Avatar for MasterGberry

I am confused, I seem to be losing the variable item.Size when i go from one for loop to the next....why? When i show item.Size the first time it shows all the #s, the second time I get straight 0s? [CODE]for (unsigned long int q = 0; q < tableCount; …

Member Avatar for MasterGberry
0
90
Member Avatar for MasterGberry

Pretty much what it says in the title, _orgDrspath = std::string, newDrsName = std::string [CODE]std::cout << "Opening original " << _orgDrsPath << std::endl; // Store all bytes into a variable called exe std::ifstream inFileDrs(_orgDrsPath, std::ios::in | std::ios::binary); inFileDrs.seekg(0, std::ios::end); size_t len = inFileDrs.tellg(); int newLen = 1024*1024; char *theDrs = …

Member Avatar for MasterGberry
0
163
Member Avatar for MasterGberry

I have spent all of yesterday and this morning trying to think of how to do this, and I am still stuck. I don't understand how I can take a std::vector<char> (bytes) and extract values from it by combining the bytes. I have read everything that people have posted but …

Member Avatar for MasterGberry
0
214
Member Avatar for MasterGberry

I am having issues with the compiler in checking to see if a piece of a string is empty or not. I have a feeling this is simple, but today has not been my day with this code, but I am still doing my best. Ty tableRow is a std::vector<std::string> …

Member Avatar for elsiekins
0
162
Member Avatar for arthurav
Member Avatar for MasterGberry

Ok, I have asked this b4, and I don't think I have gotten a straight forward answer, I really need this answered, because what I am doing is "legal", but i am 100% it does not make logical sense. This it the original C# code [CODE] var version = reader.ReadUInt32(); …

Member Avatar for MasterGberry
0
1K
Member Avatar for MasterGberry

I have been doing a lot of reading online about memory stream types, and I am trying to avoid using the gcnew MemoryStream() from the System header in this program. Here is an example of what I need to be able to use it for. [CODE]var reader = new BinaryReader(new …

0
62
Member Avatar for MasterGberry

I am having a mental block with this LINQ expression and cannot seem to figure out how I need to convert it to C++. [CODE](var item in inTables.SelectMany(table => table.Items))[/CODE] This code applies to the following piece of code [CODE] foreach (var item in inTables.SelectMany(table => table.Items)) { Trace.Assert(oldDrs.Position == …

Member Avatar for MasterGberry
0
413
Member Avatar for MasterGberry

Ok, so there is a place where the code is being converted into ASCII standard, and then being converted back I believe. I think I know how to do it, but I wanted to get help to make sure that when i am testing for bugs later that this isn't …

Member Avatar for MasterGberry
0
191
Member Avatar for MasterGberry

I know that arrays have to be given a size when using them, so I tried to, but this piece of code doesn't seem to want to be accepted by the compiler. data is a std::vector<char> so i tried using the .size() function to use the size of the vector …

Member Avatar for MasterGberry
0
126
Member Avatar for GeekInTraining

Ur code seems confusing and does not really have good labels for variables. Then afterwards u have no basic idea presented to us on how u want to use this data, try creating a better version of the FindFile Function so we can help u pass the paramters and make …

Member Avatar for Ancient Dragon
0
234
Member Avatar for Peter_morley

Remember, grid[4][9] means it goes from 0-3 and 0-8, the values 4 and 9 will not work since 0 is included. That is my first guess on the program. I haven't compiled it, but just a fast point to look at, maybe u r doing: [CODE]grid[4][0] = 0; // Not …

Member Avatar for Peter_morley
0
221
Member Avatar for Mr_PoP

[CODE]#include <iostream> #include <fstream> using namespace std; void LOGMSG(string test) { ofstream log; log.open("text.txt", ios::out | ios::app); // the ios::out means its an output, and the ios::app means Append (Add to the end of the file) log << test.c_str(); } int main() { LOGMSG("this is a test"); LOGMSG("this is a …

Member Avatar for MasterGberry
0
497
Member Avatar for MasterGberry

I am getting 2 different compiler errors of the following: AoE2Wide.cpp(1089): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'AoE2Wide::DrsItem' (or there is no acceptable conversion) 1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector(599): could be 'std::vector<_Ty> &std::vector<_Ty>::operator =(std::vector<_Ty> &&)' 1> with 1> [ …

Member Avatar for MasterGberry
0
197

The End.