Beginners - March 2018 (Page 16)

Game logic question: Containing entities within a level or overworld
 
I am looking for a way to keep track of Players, Items etc on the overworld of a game map. I'm afraid to start work on the player and item code because I'm unsu...
[1 reply] : Reading all of this makes me think you are getting a bit ahead of your... (by Manga)
by anonim
template
 
I have a stack and I have to put a value in it, but I do not understand where I'm wrong. ----------------------stack.h: #include<iostream> #define max 1000 ...
[2 replies] Last: Hello anonim, PLEASE ALWAYS USE CODE TAGS (the <> formatting button) ... (by Handy Andy)
What is wrong with this virtual function?
 
I am working on polymorphism in C++ and I am trying to stimulate a random monster attack through an abstract class with two virtual functions. One for the attac...
[1 reply] : I can see that I am being stupid with my setDamage function (Which I a... (by An Integer)
Putting a Space in cout output
 
cout << age << "is your age.\n"; I would like put a space between age & is your age in the obove example output: Thanks, Chester
[2 replies] Last: @Handy Andy already answered this question. However, you could also ... (by An Integer)
Error using isdigit
 
I wrote a program to write the multiplication table of the given factors. I tried using isdigit to write an error message when the user enters a char instead of...
[5 replies] Last: Hello delloskill, I agree with Ganado "DEV C++" is not the best compi... (by Handy Andy)
two decimals
 
how do i do the outputs to be in two decimal places. i tried setprecision but its not working. can you check what iam doing wrong please. its sales so our profe...
[2 replies] Last: Hello poonamp6792, After you read the links that keskiverto suggested... (by Handy Andy)
Need help with class constructors.
 
I can't figure out how to define a Customer constructor that takes two strings. I need this constructor to get this class to work. class Customer { co...
[16 replies] Last: Those are linker errors. They are telling you that you are trying to ... (by MikeyBoy)
by jmpc92
Reducing cyclomatic complexity of function
 
Hey there, I'm in need of some help here. Any good ideas on how to break this one function into separate functions in order to avoid having so many nested loops...
[1 reply] : Do you realize that you're copying vectors? (by kbw)
Quick question.
 
Are these two pointers the same? int value = 10; int *ptr1; int *ptr2; ptr1 = &value; *ptr2 = value; Thanks!
[1 reply] : You can write a little program to verify if they are equal or not, a p... (by TheIdeasMan)
cout (output)
 
cout << age; cout << "your age is"; How can I put the obove example on one line? Example: 2 is your age.
[1 reply] : int age = 2; cout << age << " is your age.\n"; (by Ganado)
Switch statement returns
 
I am working on a school project, and I currently am almost finished the project, but I am having some problems getting an address from the input of a switch st...
[3 replies] Last: Hello SirSkunks, This is true many times it is not necessary to inclu... (by Handy Andy)
Help with Array's
 
Hi, I need to implement the following into my code and need some help reviewing: Use 2 arrays: one for the products, and one for the quantities. Use loops t...
[16 replies] Last: I was able to create two out of three of the functions. I got help wit... (by josephhoffman28)
MadLib project, text formatting question
 
I'm having some trouble formatting the text for a homework project. This project will open a file containing the text for a madlib. It will search the text for ...
[no replies]
Functions/Testing them manually
 
I have a Project that I am working with functions, where I need to write these functions and have the code to test these functions manually. I have the followi...
[2 replies] Last: Hello bnolan22, For your last three functions you will have to give m... (by Handy Andy)
Printing Vector
 
I am not sure i am getting an error in line 43 under the '<<' before the printing of array guess_list."no operator "<<" matches these operands". #include...
[1 reply] : There is no << operator defined for an std::ostream and an std::vector... (by Ganado)
Visual Studio
 
Can someone send the link to download visual studio(the native IDE for windows?
[3 replies] Last: Creating an offline installation is easy: https://docs.microsoft.com/e... (by closed account E0p9LyTq)
Best Complier:
 
I am using DEV C++ ver 5.11. As a beginning am I using the best and easy compiler? If not can anyone give me the best advice on which one to use. I can not g...
[3 replies] Last: I am using DEV C++ ver 5.11. As a beginning am I using the best and e... (by closed account E0p9LyTq)
converting char to int, recursively
 
Hello, I have the following code to convert a character representation of a number to an integer number. The problem that I am having is breaking out the loop a...
[4 replies] Last: Yes recursion was required but i ended up figuring it out. I just pass... (by closed account NCRLwA7f)
Factorials for 1-10, but not all together. ??
 
So I have a formula, P(x)=((y^x)*(e^-y))/x! e is a constant = 2.71828 for each input I need to calculate the probability(p) of 1 - 10 customers(x) coming into...
[4 replies] Last: true. Good catch, had starting at 1 on my mind from checking the code... (by jonnin)
Savings changes:
 
Can anyone help with This? If I make a change in my codes and compile and run the program, it auto save my program, but sometimes I do not want to the save the...
[1 reply] : The compiler reads your source file from the hard drive. If you don't ... (by Repeater)
March 2018 Pages: 1... 1415161718... 29
  Archived months: [feb2018] [apr2018]

This is an archived page. To post a new message, go to the current page.