Beginners - February 2014 (Page 27)

Codeblocks Help! (Cout)
 
After the code, I need to do this: The numbers of numbers is The average of the squares of the numbers is The average the of the square roots of the number...
[1 reply] : Fist of all don't go float = sqrt (int). I would suggest switching nsq... (by kingkong200)
Codeblocks help!
 
I need to generate the even numbers from 10 to 30 (inclusive) I'm having struggles on what code to write for it. If anyone could write the code for me, just so...
[1 reply] : The easiest way is probably to use a for loop from i= 10 to 30 and ... (by long double main)
Linked List question
 
So my question is say i have a linked list with 10 nodes, how would i print a specific node . In this case, i need to print whichever node(1 through 10) that th...
[5 replies] Last: Thanks man (by bbunn77)
getline and chars...
 
The tutorial advises me to use getline unless I specifically for some rather silly reason need something else for input. At least instead of cin... I've got a g...
[2 replies] Last: Would you mind rephrase that last paragraph. I'm hoping the whole thin... (by closed account 91vUpfjN)
by rcb
starting to learn c++
 
hi, i was and still interested into programming,so far i haven't done anything concerning that so i thought that c++ is a good start , i am 16 years old so is ...
[6 replies] Last: This has got to be one of the dumbest arguments I've seen on here so f... (by HellfireXP)
Entering the filename
 
I know this sounds silly, but I wrote this program up, and it automatically accepts the filename as "example.txt" as shown in main. I have kind of confused mys...
[no replies]
Binary files help
 
this is a binary file program, but how can I read it because when I create it and input the filename, age, name , etc, it outputs on the txt file something like...
[4 replies] Last: thanks for your help :) (by closed account ivDwAqkS)
Declaring variables best practice?
 
Hi, Just trying to find out what the best practice is regarding variables. I've previously been told that all variables should be defined the moment the...
[3 replies] Last: Thanks for that. (by closed account 91vUpfjN)
by snava
Possible infinite loop?
 
I'm having trouble figuring out why this program runs what I think is an infinite loop. Specifically, I'm trying to use a while loop to raise a user defined num...
[3 replies] Last: That was it! Thank you both. *sigh* for simple syntax errors. (by snava)
Can someone explain command line arguments for me?
 
I always include the int argc and char *argv in my main(), but I never really use it. Reason is, I don't know how to use it, or what they even do. The prog...
[5 replies] Last: If you know UNIX/linux you can see the line ls -l here ls is a pro... (by JewelCpp)
Length Conversion
 
I am writing a program that converts from one unit like mm to another e.g cm. The program should prompt invalid unit when something other than mm, cm, m or km i...
[3 replies] Last: I would have to see your code after you changed it to see why it is no... (by unsensible)
adding previous sums
 
I'm trying to write a code that adds the previous. I want to keep the tally going until the user inputs zero. for example I want it to look something like th...
[1 reply] : change this: cin >> j = (x+j); to this: j = (x+j); ... (by Edward01)
Insertion Sort Question
 
This problem is really confusing me. Consider the following list: 12, 38, 45, 50, 55, 5, 30 The first five keys are in order. To move 5 to its proper posi...
[4 replies] Last: Yes that is wrong. Hint, the values after 5 are already sorted. If you... (by Smac89)
Decomposition_Powers_Three
 
I am trying to solve a problem. Write an algorithm, called Decomposition_Powers_Three, which produces the decomposition of each integer using powers of 3, name...
[1 reply] : This kind of looks like a homework problem so I won't give you the cod... (by unsensible)
Help! string list
 
Im confused as how to make a program that compares a users name and checks if it is in a list of names!!! i made the list but ya im not sure of how to do it ...
[2 replies] Last: thanks!! (by Codejunkie123)
Best way to link classes ?
 
Hey guys , I usually when I try to write something , I first think of a problem then try to solve it step by step , the best way I found is to take it one by on...
[no replies]
by xpg94
Sort function calls destructor? (1,2)
 
I have a slight problem here. Everything works fine until the part where my bunny objects should be sorted. But something happens when sort function is called a...
[21 replies] Last: Is there a compelling reason why a custom linked list is being preferr... (by JLBorges)
array of typdef
 
I have classes Skeleton, Zombie, Ghoul, ... all derived classes of UndeadMonster. I need to assign indexes to each of them, so typedef Skeleton Undead0; t...
[10 replies] Last: std::map<>::operator inserts a key default-initialized-value pair i... (by JLBorges)
by cozier
What is wrong with this for loop?
 
For an in class assignment we wrote a short program to practice pass by reference functions. Everything compiled and worked, but the final output interestEarned...
[4 replies] Last: Ah, Finally! When you break it down like you did it's much easier to ... (by cozier)
How to use a float in main that was declared in a function "body scope" on a function parameter before?
 
I can't for the life of me figure out how to use a float array declared inside function "body scope", then use the float array inside a function parameter which...
[3 replies] Last: If it has a parameter that requires a float you would just pass in a f... (by CodeGazer)
February 2014 Pages: 1... 2526272829... 60
  Archived months: [jan2014] [mar2014]

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