Beginners - February 2014 (Page 20)

by gduong
Member function
 
Cans someone give me an example of an inline function that accepts two variables that sets two private member variables. Did i do something wrong there? p...
[1 reply] : You can't return two values. Also the function type can be void instea... (by Draco117)
encryption
 
Write your question here. can someone help me I want to make an encrypter so like a=♡I n=)w t=1w and if u write ant it must give u ♡I)w1w then a dec...
[4 replies] Last: Thank u guys so much (by Tristan101)
Trouble with program using vectors
 
Hey guys. I wrote this program for an assignment involving vectors. I'm very new to vectors but I think I got it down. The code compiles fine until I try to dis...
[6 replies] Last: Thanks for testing it for me, I appreciate that. It was just a fluke I... (by SHUTitDOWNx)
array mapping
 
So I took some of my code for an array map with borders and changed it for a different layout but it is not working. Does the screen size matter or should it n...
[2 replies] Last: Thank you. I knew it was something I was missing but I couldn't figur... (by James Turnham)
Problem with initializing variables and cin
 
I keep getting this error: Uninitialized local variable 'input' used." I know what this means, but the problem is I want to cin a value. If I initialize int...
[1 reply] : [code firstline=12]int input; while (run && input <= 2) The problem i... (by long double main)
The game of "23"
 
Write your question here. Hi everyone, I am a beginner at Cpp and I've been practicing by programing this "23" game. But it doesn't work as I expected..... I wi...
[no replies]
Function for checking if one array is a subset of another
 
My goal is to find out whether one array is a subset of another, in the same order but not necessarily consecutively. For example: string major = { "a", "b", ...
[3 replies] Last: Use myFind instead of std::find then: template<class InputIterator... (by prestokeys)
by Hergie
Very Basic Lottery
 
I'm trying to make a lottery in C++ The following functions i tried to create: initialize() that takes array wins as parameter and assigns -1 to each ele...
[1 reply] : #include <iostream> #include <algorithm> #include <vector> #incl... (by prestokeys)
by tavuk
Functions not working as intended
 
None of my functions save for the one that compares the user password to the text file seems to be working as intended, what am I doing wrong? #include ...
[4 replies] Last: I think that did the trick. Also thank you for that link, it explained... (by tavuk)
by Chance
Question regarding c++ and game programming.
 
I am fairly new to programming and am trying to grasp some of the concepts of how everything ties together with c++. What understand so far is that c++ is the n...
[5 replies] Last: Ok and good luck! (by closed account iAk3T05o)
by combzy
For/ do while loop touble
 
I'm having trouble writing a for loop. I'm trying to code something like this : float val1, val2, val3; int maxpts, totppts, i, numberofprograms; ...
[2 replies] Last: Thanks, yeah those two equations I need to use for something else in t... (by combzy)
prime numbers
 
im trying to figure out how to out the prime in the third loop. but not sure of the correct way.not sure how to do third loop either. #include <iostream...
[6 replies] Last: i use your code but i cant get it to give the results all the way to 2... (by gamerasw)
repeating class based on user input
 
Hey all. So I want this program to ask the user if they have another student to input. If yes, then go through the class again, if not, exit the program. I do...
[4 replies] Last: Does it do that when you enter yes or 'y'. If it's 'y', then try a for... (by closed account iAk3T05o)
populating a struct from a loop
 
i know how to make the loop, what I don't know is how to make it add a unique value to the structure on each pass. Forgive me if the code isn't exactly right, i...
[4 replies] Last: sorry, i am that much of a beginner. can you give me an example of wh... (by spectre08)
Can't locate input file, using arrays...
 
These are the instructions for the project. I can't deviate from this, the professor has a thing about us changing things. "Collect an athlete's performance sc...
[4 replies] Last: Okay, the professor clarified to make the size 15. Don't know why the ... (by chandeliho)
Read and write file using c
 
Is there something like Java I/O in C? where I can read a .txt file then write to it? Can anyone give me the simplest form of example in C++?
[1 reply] : I/O with files: http://www.cplusplus.com/doc/tutorial/files/ (by Cronnoc)
help please
 
Write your question here. I cant figure out the errors I have taken them off and redone them. I am supposed to make a number generated maze in order for the co...
[no replies]
iterator function arguments?
 
Suppose I have a vector<int> values. Now the pair values.begin() and values.end() will cover the range of the vector. I am writing a simple function that t...
[3 replies] Last: Here's a version of nvrmnd's answer that doesn't use templates (note: ... (by long double main)
Moving strings in an array
 
I want to take one string in the array, make a copy of it in temp, move all the strings behind it up by one and place the copy in the last spot of the array ...
[1 reply] : On line 21, if (i = n-1) should have two equals signs. Also, if i ... (by long double main)
Need help with salary calculator!
 
When someone works 41 hours or more. They get paid 1.5x more so my problem is that in my else if statement. I did rate * 1.5 which should translate into 10 * 1....
[2 replies] Last: There are a couple of ways to solve this problem but first I think you... (by Garion)
February 2014 Pages: 1... 1819202122... 60
  Archived months: [jan2014] [mar2014]

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