Beginners - September 2009

Problem with exceptions
 
Hi guys. I am trying to make a simple program to divide two in putted numbers, to try and learn how exceptions work. The exception is supposed to occur if th...
[8 replies] Last: I missed that ! (by anilpanicker)
by Darqam
Itoa (integer & String)
 
Hello, I am aware that there are other subjects on this mater but they all involve "char" and what not. What I really need is for someone to help me to ge...
[3 replies] Last: Thanks allot! (by Darqam)
Stuck while trying to create loop while checking for palindrome.
 
I am writing a program that will check whether or not specific text input is a palindrome or not. I'm a little stuck trying to fit in my loop while checking th...
[3 replies] Last: I'm sorry, I haven't really messed with header files much. What exa... (by Brinkley15)
Stuck in an infinite do while loop
 
i'm trying to do my third project for c++ and i'm stuck in an infinite loop where the values of v and a appear to be a(i) and v(i). everything else seems to be ...
[4 replies] Last: i set a_max and s_max to zero in order to record the largest value for... (by celebratedsummer)
generating random values
 
Hello guys!!! I'm having problems generating random values.. actually i did that with rand() % max_number but unfortunately i'm only generating int va...
[5 replies] Last: function rand returns an integer in range from 0 to RAND_MAX. to make ... (by hamsterman)
Why is my array mostly zeros?
 
I want to flip my input vertically, but for some reason, my output is mostly zeros. Note: 17 7 in input are column and row respectively. Here is my input: ...
[2 replies] Last: Aha! Thank you very much kind sir. I must admit I am horrid at memory ... (by IamScaredOfTrees)
Get rid of repeated outputs
 
I need to write a program solving all Pythagorean triples where 1<c<500 I have my program written but i dont want it to output the triples already stated in a ...
[2 replies] Last: thank you for your time. I actually figured it out a couple of minutes... (by Grizzletor)
by joshky
vector of strings
 
ok, i'm using a vector of strings to store a word list loaded from a file. The program works perfectly but it cuts all the words off to 8 characters. Is this d...
[6 replies] Last: Generally though use of angle brackets in #includes denotes a "system"... (by jsmith)
by wasabi
Dynamic memory, copy constructors, deconstructors and return values
 
I have, over the last few weeks developed a code for my internship that allows for efficient data-gathering from a mastodon of a text file (I mean, a 150Mb .txt...
[14 replies] Last: In general, if you need a user-defined copy constructor, you need a u... (by jsmith)
Confused as to indentifying parts of a loop
 
Last <- 0; Current <-1; while (Current < 100) do (print the value assigned to Current; Temp <- Last; Last <- Current; and Current <- Last + temp) ...
[3 replies] Last: Well I would say the body of the loop is from "while (Current < 100)" ... (by mcleano)
Why is this not acceptable?
 
bool get_player_turn() const { p1_turn ? return true : return false; } Question in the title.
[8 replies] Last: 1. It's not C. 2. p1_turn is bool. (by Chewbob)
by Mazer
need program
 
Hi, I created a "program" on cmd but i want to make interface and something more on that i think c++ can do this but i dont know how maybe some one can help ...
[no replies]
passing array from function back to main function
 
hi i am wondering that is it possible to pass an array from a function back to the main function i wrote a code like this #include<iostream> using name...
[5 replies] Last: thanks guys now i got it i knew where is my mistakes already its a... (by loveless)
beginner C++ question????
 
In C++, can all operators be redefined for user-defined data types?
[1 reply] : Most, but not all. The Wikipedia article is pretty good http://en.wik... (by Duthomhas)
by wtf
What is the actual RNG that my compiler uses for the rand() function?
 
I have not been able to find the documentation for it. It always begins with this sequence when I do not seed it with time first. 41 18467 6334 26500 1...
[4 replies] Last: Moreover, the RNG that comes in the standard library is underpowered a... (by Duthomhas)
algebra calculator
 
i dont know how to do this but, i need some thing (calculator) where the user types in the whole problem in cluding operators and the program calculates the thi...
[5 replies] Last: It works but y is it so slow??? code: #include <std_lib_fa... (by beginner at programming)
Employee Class. 3 files
 
Ok guys I need some assistance :) --- I am very much stuck on this Employee class, it's for school. Constructor should have 3 parameters. Provide a set ...
[7 replies] Last: Would my constructor be: void Employee::setsalary( int salary, string... (by ashley19)
by n1312
Looping technique.
 
Hello I am not sure as to how to approach this problem, The inventor of chess wanted his reward and he asked the emperor one grain of rice for the first square...
[4 replies] Last: @anilpanicker: I was recently yelled at for posting a solution, you sh... (by turbozedd)
Can't figure out how to get percentage
 
My homework assignment is as follows: write a program that asks the user how many trials they would like to run. Then, simulate the roll of 2 six-sided dice...
[4 replies] Last: Oh my... thank you for the help. I really appreciate it :) (by beginnerprog8755)
Getting the two digits from a double digit
 
int double_digit, first_digit, second_digit. I ask the user to enter a value for "double_digit." User enters 24, how can I separate the 2 and 4 and place the 2 ...
[2 replies] Last: Thanks chew, it works... (by foncused)
September 2009 Pages: 123... 23
  Archived months: [aug2009] [oct2009]

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