- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
48 Posted Topics
Re: I don't have any books, but I've got an excellent place to start. I started teaching myself C++ about 2 weeks ago and have had a lot of success with several online tutorials. After sifting through the entire World Wide Web, I've found a lot more trash than noteworthy sites; … | |
I have a vector class that is defined using a template. VS 2010 is underlining every instance of these templates, claiming that the identifier Scalar is undefined. Peculiarly, these errors only occur in the definition of the class I will list first but not the one that inherits it. Here … | |
So I'm currently using Lazy Foo's tutorials. Here's the link: [url]http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet05e/index.php[/url] I followed all the instructions, but I'm having a couple issues. So when I choose an empty project, like the tutorials recommends, as opposed to one with a precompiled header, the C/C++ tab does not appear, and I am … | |
Re: so you want to essentially fill an area with some sort of shape? if x=10, y=5 and z=3.14, you will only have a single pointer located at those coordinates. There is nothing to iterate through. You will need a range of coordinates: for example, x = [5 - 10], y … | |
Re: [QUOTE=jeezcak3++;958286]Thanks! i guess it was not easy for anyone at first?[/QUOTE] well, let me give you one tip that no one ever gave me. Do Not use learn c++ in 21 days. It is decent, but there is a much better tutorial: Use the tutorial at learncpp.com. It is a … | |
Re: Random question: Is it a general rule that the level of indirection on both sides of the = operator should be equivlant? | |
Re: [QUOTE=VernonDozier;951978][url]http://lmgtfy.com/?q=tridesclist[/url][/QUOTE] no offense, but I don't think anyone is going to help you after that post... By the way, the Google search produced nothing | |
This program is frustrating me. I cannot for the life of me figure out what is causing this error message. It's the sort of thing where I fix one issue only to cause 10 more. The compiler is giving me like 8 identical pairs of errors, one for each Ball.itsPosition.getX/Y … | |
Re: why did you change CandyBar* cb = CandyBar new[3]; to CandyBar* cb = new[3]; How will the compiler know what type the array of 3 is? Is that implicitly defined by the fact that cb is of type CandyBar? and because something of one type must point to something else … ![]() | |
Re: you need to include the string library #include <string> | |
I'm trying to write my first game, and in order to do so, I need to design a recursive algorithm with backtracking capabilities. In the game, there is a grid of tiles. Some of these tiles back be moved to; however, a few of them are impassable. The goal of … | |
Re: I think you just need to make d a float instead of an int | |
There is clearly something wrong with the else statements in this code. This program essentially mirrors the attack/defense rules in the game risk. The attacker roles 3 times. The defender 2. The best two roles of the attacker are taken and compared to the defender's two roles. The defender wins … | |
If you look at the end, i try to store some values in a few arrays. When i try to print these out, I receive complete junk. any thoughts? [CODE=C++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define MAX 122 #define MIN 48 char GetRand(); void RC4(char *realpw, char … | |
If you run this code, you will see that the first two lists values do not show up. I'm pretty sure this is because I am trying to print chars as numbers. I'm just wondering how to do this. Thank you. [CODE=C++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> … | |
So I've got a program that takes an encrypted file and essentially decrypts it. I am now trying to modify this file. During the encrypting process, the words were scrambled by position. The location of each word is marked with a position value. I decrypted the original text, so now … | |
Alright. This is a pretty simple program. The program simply reads a simulated DRM (basically an encrypted plain text file) file that was encrypted using RC4. It then reads a plain text file that contains the exact same plain text that the DRM file would decrypt too. (This is assuming, … | |
I'm currently taking a computer security class. The thing is, I haven't even taken an intro computer programming course. I taught myself a good deal of C++ back this summer, but I hardly know as much as the other students in the class. we were asked to manipulate the following … | |
So I am using Dev C++ to compile this program; however, whenever I attempt to compile, I recieve a linker error that states, "[Linker error] undefined reference to '_cpu_features_init' ld returned 1 exit status" I googled the question, and people suggested that it may have something to do with the … | |
Re: I admire your courage salman. When people come and... well.. sort of insult you (no offense to anyone), you simply drive forward with further questions. Keep the same attitude, and you will be as proficient as anyone at C++. | |
I am currently reading the learn C++ in 21 days tutorial. In a chapter on references, when the author summarizes some of the main points inside a respective section, he explicitly states, "DON'T return a reference to a local object. " I am simply curious what this means. I have … | |
I've always used the Dev C++ compiler; however, I keep hearing how the software has little support. Additionally, I have heard people praise the debugger of Visual C++. So, end result, I'm deciding to switch from one to the other. My only problem now is that I can't make the … | |
I've got something like 400 lines of code at this point, and I realize that not too many people will be inclined to look at it. Thankfully, the majority of it works swell, and I only need part of it examined. I realize that my use of vectors is not … | |
As I write my code, I am realizing there are numerous places where a type int could easily be substituted with a type char. Because type char uses less memory than its int counterpart, I am curious why people don't prefer the former more often. for example, it's not uncommon … | |
I have a function inside another function that is called by main(). Inside the innermost function a vector is created, which I would like to return to the first function, which I would further like to return to main(). I suppose that I could create the vector in main and … | |
I am having a compiling issue because of some syntax errors while trying to return an array. You can probably ignore most of the code below; I am only concerned with the call and return of the CreateBoard[][] array. As I understand a pointer might be necessary to do this. … | |
Re: You're using the beginner's guide to C++ game programming! I wrote the same program. Let's see what mistakes I can find. Below is the code I used. Let's see if we can just compare the two. [CODE=C++] #include <iostream> #include <string> #include <vector> using namespace std; int main() { int … | |
I'm trying to skip part of my loops by using continue; however, I am unsure where how much code each continue statement skips. My suspicion is that, in the below code, the continue statements effectively do nothing and put my code right before the return false statements. I have marked … | |
I've got a pretty simple question. I'm trying to ask the player for to choose a difficulty. I want the case to be to not affect his choice, so I am using the toupper() function. Unfortunately, when I try to return the value of the difficulty, no matter what difficulty … | |
I currently have a program that writes Sudoku boards to files; however, I would like the program to be able to read the board already in the file, copy it and then add another board to the file. It follows, then, that if there were two boards in the file, … | |
So I have a multi-dimensional array, and I want to pass a reference of it to another function so that the array is defined in the scope of the function, because the array is not a global variable. If I can remember correctly, the syntax looks a little like this: … | |
I basically need a function that, after a certain amount of time has elapsed, will restart a program from scratch. This is because the code can get stuck at a certain point if wrong decisions are made. I am curious how to go about making this. I am sure it … | |
Re: Well, this assignment is a classic example of game theory. It might help to read up on the prisoner's dilemma to get a better idea of what the assignment is asking for. | |
So I decided that I wanted to make a Sudoku creator and solver for fun. My plan is to fill a sudoku board with random, however, compatible answers using brutefruce. I simply check random numbers against the two prerequisite rules for a legitimate Sudoku: a given cell cannot contain the … | |
So I'm trying to create a fairly simple program that allows a user to modify a list of games. The user can add, remove or simply call an enumeration of the games currently inside the list. The compiler keeps telling me that there is a problem with my use of … | |
Typically the code that I have seen uses phrases such as i++ as opposed to ++i. Recently, in a recently purchased book, I have seen the former implemented. As I understand i++ means that the addition takes place after the line is executed and thus with the initial value of … | |
Re: Look at that error message. The answer is starring you in the face. Take a close look at the following line: C:\Dev-Cpp\payroll.cpp:24: error: expected `;' before "return" This should solve all of your problems | |
Re: He's not really being a dick. He's just telling you plainly what you did incorrectly. You probably want to add the comments first. all you need is the // in front of the text you want to be a comment, meaning that it will not be interpreted by the compiler … | |
Re: I'm not sure if you care or not, but your sum variable does not include the value when n = 0 (1). | |
Re: in line 12 " while ( total < size && std::cin>> word )", why do you include "&& std::cin>>word." Why would this be a condition of the while statement? Shouldn't it be a statement that is executed if the while statement is true? | |
Re: Using namespace std tells the compiler where the functions following it will be located - in this case, it is the standard library, hence std. Alternatively, you could put std:: (code) before every line to specify that the following code is from the standard library, but this method would be … | |
![]() | Re: okay... here are a few decent sources. [url]http://www.cplusplus.com/doc/tutorial/introduction.html[/url] this site is quick but a little brief at times. It is more of an example reference. [url]http://newdata.box.sk/bx/c/\[/url] This is simply a more clear but longer version of the first site. [url]http://www.steveheller.com/cppad/Output/dialogTOC.html[/url] This is definitely the most detailed of them all, sometimes … |
Re: [code=C++] #include <iostream> using namespace std; int main () { float goldennumber, dummy; float finalnumber; float ratio = 0.618; cout<<"Welcome to Easy Golden Ratio Finder!\n"; cout<<"\n"; cout<<"\n"; cout<<"\t Please enter the length of the rectangle: \n"; cin >> goldennumber; finalnumber = goldennumber * ratio; cout<<"Your number is: "<< finalnumber <<"\n"; … | |
I'm hoping to create a program that allows a user to enter several points, their coordinates and their masses and then calculates, over a period of time, each points' new coordinates due to gravity. I've started a code to calculate position, and I'm trying to understand why DEV C++ keeps … | |
Re: There are a few issues. In the line, "string input = Add;", I don't think you need the Add there. All you need to do is initialize the string input. The line if(Add) needs to be changed to "if(input == "Add"). Additionally, every if line needs to use ==, not … | |
I started using the tutorial "Teach Yourself C++ in 21 days" yesterday, and I absolutely love it's clarity. However, there is one thing that perturbs me about it. All of the code written in the code is numbered. This is a great feature until I want to try running the … | |
[CODE=C++] #include <iostream.h> int main() { enum Days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Â_Saturday }; Days DayOff; int x; cout << "What day would you like off (0-6)? "; cin >> x; DayOff = Days(x); if (DayOff == Sunday || DayOff == Saturday) cout << "\nYou're already off … | |
[CODE] #include <iostream.h> #include <time.h> #include <stdlib.h> #define MAX_RANGE 1000 main () { long value, guess; int tries = 0; srand ( time (NULL) ); // Initialize random generator value = rand()%MAX_RANGE+1; // Get random between 1 and MAX_RANGE cout << "A random number has been selected between 1 and … |
The End.