Beginners - March 2014 (Page 5)

by Godric
Automation
 
Hello, all! I want to learn C++ to make some automation, like controlling a window while I do other stuff. For example, while I am here reading the tutorials...
[no replies]
Stack error / Can't push and pop 1 item
 
Hi all, I am taking a data structures class and all of the code except for the stackTest.cpp file has come from the instructor as part of the assignment. If ...
[no replies]
finding the largest number. HELP!
 
I am trying to hone my skills a little here (or what little skills I have obtained so far :P) and I found a problem that asks you to prompt the user to input ho...
[8 replies] Last: Technically, you would want to initialize maximum to the smallest val... (by wildblue)
do-while problems
 
Yesterday I decided to compose my own calculator just for fun and right now I'm trying to make it able to repeat operations via do-while loop. Algorithm looks l...
[3 replies] Last: Thanks for clarifying your question. To do what you want, you just nee... (by Stormboy)
by jf1963
char variable question
 
i'm just messing with simple test code and i'm asking the user to input two integers and then one of four math functions, + - * /, and then am outputting the re...
[4 replies] Last: i thought maybe there was a way to use the variable in the equation. t... (by jf1963)
Count newlines, blanks and tabs
 
I have the following exercise: Modify our vowel-counting program so that it counts the number of blank spaces,tabs and newlines read #include <iostream...
[4 replies] Last: Use unformatted input. #include <iostream> #include <cctype> int ma... (by JLBorges)
by dayan1
Product w/functions problems
 
The problem asks me to ask for a number between 3 and 8. The calculate the product between 2 and that number. So if the number chosen was 5, the result would be...
[1 reply] : You never call your product function in main. In the "else" condition... (by wildblue)
can someone find whats wrong here?
 
This is my program #include<iostream> #include<fstream> using namespace std; char ch; int x, y, num=0; void rectangle (char, int, int); void line ...
[4 replies] Last: This is the animals.dat file tiger dog racoon zebra aardvark hippopota... (by owenkmc)
Object undefined
 
Hello, I am writing a small text-based rpg. The issue I'm having is I instantiate a spell in the main function but in a different function in a different .cpp f...
[2 replies] Last: How do you get fireball to this file? You can't use variable defined... (by Mechennyy)
checking if a number present in a file
 
hi how would i go about checking if a number entered by the user is present in a file? i will not know what the user enters and the file is set out like 1 4 5 ...
[3 replies] Last: Instead of while (inFile) { in>>filenum; do this: wh... (by Chervil)
by rs14
Hey there, I am new here,need help
 
I want to solve an exercice that requires to find if a number is "Armstrong number" or not..I coded it but some problems are appearing there.Please give me some...
[no replies]
Help problem with a program
 
Hello, I am starting programming and am on my second assignment. The program is required to ask the user for an integer, then convert the integer into a str...
[10 replies] Last: Thank you for the hint i am going to complete the program. This topic ... (by DailyDoobie)
by enemy
references type& identifier / type &identifier
 
Hello! Please, just checking if type& identifier is equal as : type &identifier. If not, pleae, where can I find out about the differences? Many thanks!
[2 replies] Last: Thanks, firedraco, just wanted to be sure!!! (by enemy)
Calculator Errors
 
I'm trying to make a small calculator. First I have to choose + or - and then I will enter the numbers... When I select - using number 2 it wont go directly to ...
[1 reply] : You need to put braces around the contents of your if statements, othe... (by TwilightSpectre)
by Ncf
Vector subscript out of range error
 
I´m suppose to create a function that implements bubblesort my problem is I keep getting the same error over and over again "Vector subscript out of range erro...
[2 replies] Last: Thank you,now I that I changed to vector<int> subst; //an empty v... (by Ncf)
Create an array of strings via cin or getline
 
Ok so I searched this site, and google string arrays, but I couldn't find anything on how to create an array to accept string input. In other words the strings ...
[2 replies] Last: thank you..That worked.. (by dariusd7)
Bool type and exponents questions
 
I'm pushing my knowledge on this program and so far so good but I came across 2 errors. Program Calculates the area of a rectangle or triangle, or the volume of...
[1 reply] : // if (areaVolume = "area") if ( areaVolume == "area" ) baseCube ^... (by JLBorges)
Passing two parameters: one by const ref. and another by ref.
 
Is it okay to pass two parameters to a function with one by constant referecne and the other by reference? void getUniqueIP(const vector<string>& refIP,...
[1 reply] : Yes. Prefer 'reference to const T' over 'constant reference to T'. C... (by JLBorges)
by giblit
Boost multiprecision cpp_int
 
Does boost ignore the parenthesis operator precedence? #include <iostream> #include <boost/multiprecision/cpp_int.hpp> int main() { const boost::multipre...
[12 replies] Last: Changed 4 days ago by johnmaddock Status changed from new to closed ... (by JLBorges)
Ordered Linked list using classes
 
Here is the code that I've written. It would be used to add an object of class Character. The only argument passed is a pointer(Character *newCharacter) to the ...
[1 reply] : struct Character{ Character *next; //¿do you have this? }; ... (by ne555)
March 2014 Pages: 1... 34567... 79
  Archived months: [feb2014] [apr2014]

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