Beginners - October 2009 (Page 15)

by x5aint
Array and Fuctions to Calculate Average and Grade Point....
 
I am not really sure how i would go about finding the average of two arrays while their in a function. Can someone point me towards the right direction, i would...
[9 replies] Last: got everything working! thanks for helping a newbie lol.... (by x5aint)
standard input(cin>>)
 
please i will like someone to dymystify the use of the standard input for me.Anytime i call the function the output is always the cout that precedes it while su...
[4 replies] Last: yea i figured it was for homework purposes, my fault for creating secu... (by btripp)
passing arguments with template class
 
How do you pass an argument with a template class? I have a templated class in a .h and then a main.cpp and in my main.cpp I am getting an error that says the...
[18 replies] Last: No, charHold is a char int main(int argc, char *argv ) { sequ... (by cannsyl)
str/char 101 question
 
Hi I read a program which has a char array : char str . The user is supposed to input a string which can be less than 80 char. After that use gets(str) to re...
[3 replies] Last: http://www.gidnetwork.com/b-56.html (by Duthomhas)
by nigel
Poker probability
 
I am just calculating the probablity of a straight and a flush. The proggramme should deal 5 random cards, 1 million times, checking for a flush and straight ea...
[1 reply] : Yes, your deal algorithm allows you to deal out the same card twice (o... (by jsmith)
Function does not work!
 
#include <iostream> using namespace std; double depreciation (double, int); double carrying_value (double,double ); double amounts ( double, double); doub...
[2 replies] Last: Line 28: cout <<" " << count << " " << carrying_value << "\t" " ... (by Bazzy)
Factorial Table
 
I made a program that finds the factorials. However, the next step is that I need to put it in table format. To output how the computer came up with that answer...
[1 reply] : int main() { cout << inputNum << "'s factorial is: "; fo... (by mcleano)
Some bitwise stuff
 
Is there a way to always flip a bit to false? For example, if I had A = 4, B = 8, to always flip the 4th bit to true, is this: A |= B; Whereas I'm curren...
[1 reply] : A &= ~B; (by Abramus)
by mcb413
arrays and void functions
 
Hi guys, I need help with arrays and functions. I have to do the following:Write a C++ program that has a main function and one void function. The void funct...
[2 replies] Last: Oh, wow. This is a new one. He posed the same thread twice, but the se... (by helios)
Allegro & MSVC7
 
I'm having trouble even with simply getting the following code to work, so I'm sure I haven't set up something right. // AllegroWin32ConsoleProject.cpp : De...
[6 replies] Last: It's not such a good idea to copy libs and stuff into the VC++ install... (by helios)
Infinite Loop =/ I only want it to run 5 times.
 
I added a while loop, with counter. But I'm not sure why it's an infinite loop. can someone modify this so I can learn what I'm doing wrong? I only want this lo...
[7 replies] Last: *Smacks head* Thanks wachtn. I wasn't aware that I could just stick... (by ashley19)
by wachtn
Get line x from a file
 
How would I write the function to get line x from a file? It should act like this: char name file = "a_file.txt" name << line(x) from "a_file" ...
[4 replies] Last: Thank Duoas. Your code is much better than mine. I had looked at the r... (by wachtn)
find rectangle overlap
 
hi everybody there, I received a job from the my lecturer to complete a code that find two rectangle intersection. here is the code: //#include<rectangle.h...
[5 replies] Last: thanks a lot guys and you screw sorry I was having many work to do w... (by zubaidi hack)
by r3n311
wxWidget or WinApi?
 
any suggestions where to start learning programming with GUI's, wxWidget of winapi? i still dunno what this two guys are,. so needed some advice from you guys.
[1 reply] : wxWidgets can be used for cross-platform programs (Linux, MacOS X, etc... (by PanGalactic)
by Beaner
Ignoring %
 
If i have a number like this: 8.00% How can I get my program to only grab 8.00 and get rid of the %?
[3 replies] Last: Like Duoas said, instead of directly cin >> 'ing the integer, get it t... (by bluezor)
Finding a linear root using a loop
 
Hey, basically the goal of the assignment was to create a program that would prompt the user to enter in the m and b values for the equation y = mx + b and then...
[1 reply] : As far as I can tell, that loop looks correct. But just a couple thing... (by helios)
[class constructor] function foo to make _job job#.name where # is foo parameter
 
int nDqJobIndex = 0; void dqJobNew(int &nDqJobIndex, string szName, string szTitle, int nSalary, int nCreditYearsMin) { _job job"nDqJobInex";//??? //(......
[8 replies] Last: Ah, thank you. Old code: _job(string szName, string szTitle, int ... (by Archaea)
by tiptip
Prime Number ASAP Please
 
3) Write a C++ program to ask the user to enter a number N from the keyboard and then check whether the entered number is prime or not (use while loop). Your pr...
[2 replies] Last: That's quite easy. I would help, but you don't seem to have any code.... (by mcleano)
Print a line with * depending on integer from user
 
I have to write a program that prints * depending on the user input. The user inputs 5 integers and outputs the corresponding *'s. So 1=* 3=*** 5=*****, etc. ...
[4 replies] Last: Either or. Personally I would do the while loop option so you don't en... (by mcleano)
by tiptip
Go-To loop ASAP please
 
1) Write a C++ program to write your name infinite number of times on the computer screen (use goto statement). 2) Modify the program written in step 1 to pr...
[1 reply] : Using goto for a loop is bad, using it for an infinite loop is stupi... (by Bazzy)
October 2009 Pages: 1... 1314151617... 25
  Archived months: [sep2009] [nov2009]

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