Beginners - February 2015 (Page 43)

Nested loop
 
How would i output "A1B1B2B3A2B1B2B3" with nested loop? ik i should know how to do this and its driving me insane because i cant figure it out? please h...
[7 replies] Last: If you look at the time stamps mine was posted 1 minute after yours :P... (by giblit)
by gk9
Display array as histogram
 
Hi all, I'm trying to display values of 4 dice rolls as a horizontal histogram, which would look like: 4: *** 5: ***** 6: ****** and so on until... ...
[2 replies] Last: Thank you! Your answer was really helpful in trying to store the occur... (by gk9)
by pik
i need help trying to infile grades to an array and grade distribution
 
I've been trying to get this program to run but I have been having trouble infiling the grades from a .txt file. I also have a few other errors in my Calculatio...
[18 replies] Last: got it working...Thank you for all your help (by pik)
by h4ever
how to get time (year,month,day,minute,second) with libpng
 
I have a struct of this type and need to set the values for the struct: typedef unsigned char png_byte; typedef unsigned short png_uint_16; typedef stru...
[1 reply] : I have found (here: http://www.libpng.org/pub/png/book/chapter15.html)... (by h4ever)
Can't find largest number
 
When I run this code, it always tells me the largest number is the first one inputed. Why is that? I know there is a more efficient way to do this with an arra...
[3 replies] Last: Just for case you are interested in my solution. I needed to find out ... (by h4ever)
infinite while loop
 
Hello, can someone help me understand why this goes into an infinite loop? I void collatzIterative(int n) { while (n > 1) { if (n % 2 ...
[1 reply] : once n = 1 shouldn't it get out of the loop? Yes. If only n made it... (by closed account D80DSL3A)
Generating random text
 
Hi, i need some help, i would like to generate unique random alphanum strings for different products in my application, yesterday i asked this question but i go...
[10 replies] Last: Thank you very much @JLBorges lemmi take my time n study this carefu... (by closed account SECMoG1T)
by tbrady
Function which counts the even numbers in an array
 
For my computer science class I have to write a function that will count the even numbers in an array and for some reason my code is failing. I think it might h...
[1 reply] : Why doesn't it work for you? This works great for me (click the gear o... (by TheHardew)
Help with sorting even and odd numbers c++
 
I need help writing a loop to check an array of numbers and move the even numbers to the right side of the array. I am stuck trying to write a loop to switch t...
[17 replies] Last: > how would you go about adding another array to the code Once it is ... (by JLBorges)
Simple Timer
 
Simple Timer code #include <iostream> #include <Windows.h> using namespace std; int main() { int hours; int minuets; int seconds; int Tota...
[no replies]
help with functions
 
I need help figuring out how to work this program. c++ is telling me:`init_game' cannot be used as a function, along with 'ask_move' , and 'declare_winner'. ...
[4 replies] Last: thanks for help (by axel609)
need help related to function program
 
whenever i try to compile this program error comes that you can not use fibonacci?number as a function. please solve this error. #include <iostream> #inc...
[3 replies] Last: Just change the name of either the function or the variable so they ar... (by closed account D80DSL3A)
Year,Month,Day...? Anyone?
 
How's it going guys, I need a little help on this code I am working on for the extra credit problem on my homework. It says to write a C++ program to allow user...
[4 replies] Last: Alright thank you for the help I finally got the code working correctl... (by ProgrammingIgnorant)
Function as left operand
 
I am working on an assignment from class and I am getting the following error in my code. grtax.cpp(30): error C2659: '=' : function as left operand ...
[1 reply] : Line 15: float mTaxRate(void); you have indeed declared mTaxRate to ... (by closed account D80DSL3A)
Creating a folder in program's diectory
 
As you know, ofstream can't create folders. Using windows.h function CreateDirectory, you must know the full directory. But i need to place that folder in a dir...
[no replies]
allocate memory at a given pointer to memory
 
I tried to cast an int * to struct * . It is not working exactly as i wanted it to be. #include <bits/stdc++.h> using namespace std; struct my_malloc ...
[4 replies] Last: I still don't know what you're trying to do for sure, so forgive me if... (by tipaye)
Const Reference [Updated] NEED HELP!
 
I need my program to do this: Write a program that asks a user how much change is to be given. Pass the amount to a function via const reference. Figure out wh...
[4 replies] Last: There is one problem: due to rounding errors, it's possible for newmon... (by dhayden)
Specific usage of if loop
 
Hey guys. I'm practicing programming from this book I have, and one of the solutions contains this unusual usage of if loop: (simplified code) #include <iost...
[8 replies] Last: Also, if is not a loop... (by tipaye)
by GOPI56
Help me,I have written a program but the program is not running.
 
I having written a program but the program is unable to run. #include <iostream> #include <string> using namespace std; struct student{ int stude...
[1 reply] : Not running ? am sure that's no the best question :(), now here is you... (by closed account SECMoG1T)
by kiri
Link for a better explantion of setw
 
The explanation on Cplusplus is not in depth enough for me. Thanks in advance if anyone knows of one. ( the Microsoft one had me lost in the sauce.)
[8 replies] Last: After reading andy's and JLBorges I have a better understanding on thi... (by kiri)
February 2015 Pages: 1... 4142434445... 52
  Archived months: [jan2015] [mar2015]

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