Beginners - July 2013 (Page 21)

by zagzag
change a value in an array.
 
okay so i am using composition and i have //loc is to get the location of the account I want accounts .getbalance() //I would like to add 10 to this ...
[2 replies] Last: Yes you are right that is the function int getbalance that I have. So... (by zagzag)
Three Seperate Functions
 
Basically, I have this code that has three separate functions, but it's all under the int main(). What I want to know is how I can separate the three functions ...
[10 replies] Last: Barely, and I forgot to omit those from earlier. (by firstlast)
container to hold numerous data types (1,2)
 
In python, lists allow any object or rather data type to be inserted into it, while also allowing to shrink and grow dynamically. Is there an equivalent in c++?...
[29 replies] Last: I was playing around, you would need to keep track of what is stored ... (by cire)
by Ganado
RBG value editing problem/question
 
In my C++ book, there is an example program that will invert the colors of a .bmp (24-bit Bitmap) image. I don't think I need to copypaste the whole program for...
[3 replies] Last: Thanks for the replies, Stauricus and tntxtnt . Absolute value woul... (by Ganado)
if statement not working
 
I'm trying to calculate gross pay with a simple hours worked * hourly wage. If the user has worked more than 40 hours the user should get time and a half on onl...
[1 reply] : my assignments were reversed in the function definition =_=" (by rajputsadia)
by krutuk
Please help, .lock() doesn't work
 
I learn smart pointers. And right now I am learning reference loop. I found some code in net and changed it, but it doesn't work. Please help. Function .lock() ...
[4 replies] Last: Peter87, thanks man, you really helped! (by krutuk)
Double trouble with vectors
 
Hi all. I'm having trouble creating a program that creates a fish tank with which fish can be added to. The function below is kind of a fish tank builder. I hav...
[4 replies] Last: Oh! I see. Thank you very much. I'm having another problem when writin... (by Redeyery)
slicing a string
 
hello everybody i want to know how can i split a string in smaller strings. yes, i do know about substr(). but the problem is how to find exactly where it shou...
[5 replies] Last: ooh, now i got it. i didn't knew that getline changes the original str... (by Stauricus)
How can I solve this problem
 
So this is the code I wrote Main: #include <iostream> #include <string> #include "login.h" using namespace std; int main(){ login obj; ...
[1 reply] : You never call setUsername and setPassword. I recommend making them co... (by Ispil)
Funtion calls? Variable not initialized?
 
Im trying to use functions to display the letter grade and percentage in a course. When i run my program it says that the variable 'OverallPercent' and 'letterG...
[4 replies] Last: I apologize for my coding style. I find programming very fascinating b... (by rajputsadia)
how to use a function with pointer parameter to print array
 
The printArray function should take in the dynamically created array and the size of the array as parameters. It should print out the contents of the array. ...
[1 reply] : Well, that's only a skeleton, it doesn't even have names for the param... (by Chervil)
Text File Reading Program
 
I'm writing a program which reads a couple of lines from a text file, each line contains a name and a score, for example: "Robert Plant: 50". The program then o...
[1 reply] : std::string name; int score; std::geline( std::cin, name, ':' ); std:... (by ne555)
Debug Assertion Failed
 
Hi all! So I've debugged this program a few times and it has worked just fine, until now for some reason.. When I run it now and when I've written down 10 "d...
[no replies]
Is this comparison valid?
 
As the title says, I'm wondering if this comparison with characters is valid. I want to check if the character is a number from 0 to 9. char c; if(c >= '0' &...
[9 replies] Last: A chess program? That's got to be very complicated, especially the AI ... (by GoranGaming)
Inversion of numbers (1,2)
 
How do I reverse decimal numbers? ex : 2.369 => 963.2 Meanwhile without strings Please help me!
[30 replies] Last: Manipulating the float data and keeping it unchanged is almost imposs... (by jrfrago)
by axdel
Get lowest value in array function
 
So I finally got this to compile and now I have to set it up to remove the lowest score from arrays stu1-stu5. I started the getLowest function and I know how t...
[no replies]
Arrays and pointers problem!!
 
The program should ask the user how many students were surveyed and dynamically allocate an array of that size. The program should then allow the user to enter ...
[5 replies] Last: Thank you! (by cPPbeginner17)
by axdel
Function array get lowest value problem
 
I am getting expected primary-expression before '<' token and expected ';' before ')' token where indicated. My code in this line is identical to the way I ...
[1 reply] : NVM, after seeing it here I saw the extra ) in the line. (by axdel)
by JB2005
reading a file and finding high and low number
 
It reads numbers from a file and then it is supposed to tell the user the highest and lowest number. Seems like all the info I can find is having the user type ...
[3 replies] Last: > So it needs to pull a number to give the lowest and highest a number... (by JLBorges)
increment and decrement
 
here is a snippet void main() { int a=6; a*=++a; printf("a=%d",a); } output 42 i m confused how does the increment and decrement operator work.
[3 replies] Last: a*=++a; you multiplied (a) by itself but not stored to (a) yet then ... (by jrfrago)
July 2013 Pages: 1... 1920212223... 53
  Archived months: [jun2013] [aug2013]

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