Beginners - August 2014 (Page 27)

by Nison
Strings.
 
There seems to be an error for some reason and i don't understand why. This program is supposed to convert the text from string s1 to string s2 in Capslock with...
[2 replies] Last: Try it this way Yes, it did work. Thank you very much! (by Nison)
Practice
 
Hi guys. Anyone know a good website were i can do practice programs. Basically i want someone to give me a program to write. I want to get better so anyting can...
[5 replies] Last: this site's tutorial (by xenovia12)
Issues with default for an int
 
Ok, I am a newcomer to C++ and running into an issue. I am using the introductory book by Stroustrup and attempting some basic code with int that I am running ...
[6 replies] Last: Something like this perhaps: If extraction fails, failbit is set an... (by JLBorges)
std::string to int
 
Why this code fails? I am converting a string to int by indexing. #include <iostream> #include <string> int main(){ std::string s1 = "12345...
[5 replies] Last: Line 7 doesn't do what you want. s1 gives you a char , which is an... (by Peter87)
Where is "int n" declared?
 
What am I missing? This sort.cpp from CppWOF CH 6 works fine. (I just commented out the Pause for Netbeans to be happy.) I thought that you can't declare a ...
[8 replies] Last: You had essentially: void swap(int *p1, int p2); void swap(int *p1, i... (by keskiverto)
for loop until 0
 
how can I write the code to loop the a value to 0 without using signed int? I try ==0, but it doesn't work for(signed int a=10;a>-1;a--)
[4 replies] Last: thx (by csbs5c26)
Troubles Understanding Variables in Classes
 
Hi, I'm relatively new to C++ programming, and currently struggling to understand use of some functions. At the moment, I've been using this tutorial for help: ...
[1 reply] : class what{ int x; public: int getx(){ return x; ... (by LendraDwi)
by akif13
Searching
 
User input: 1, 2, 3, 4, 5 How do I display "Target Found" when user entered 3? I get the output like this when user searched 3. I know it is because of for loo...
[1 reply] : [code firstline=31]bool found = false; for(i=0; i<5; i++) //the loop i... (by Smac89)
int menu and char's being input
 
I am writing a code where I ask the user to input a value of 1 2 or 3. If the user enter's a char, the code breaks and enters an infinite loop. How do I sto...
[1 reply] : char x; int y; cin>>x; if(isdigit(x))y=atoi(x); //you can do somethi... (by LendraDwi)
Multi Arrays
 
Hi guys, im struggling with multidimentioal arrays. I have a basic understanding but I cant figure out how to make multi arrays with integers and strings. What ...
[1 reply] : I don't think its possible but if it is every employee have 4 salary (by LendraDwi)
by wolfv
Break loop when key is pressed
 
I saw some complicated solutions on the web, but am hoping for something simpler. For this application, simple is more important than robust. I want a conso...
[4 replies] Last: Thanks Duoas, the example on http://www.cplusplus.com/forum/beginner/5... (by wolfv)
by sjabat
COFFEE SHOP PROGRAM void
 
HELP about void!!! it outputs error. 49 11 C:\Users\Skye\Documents\wh.cpp '::main' must return 'int' #include <iostream> #include <fstream> #include <co...
[4 replies] Last: [quote=bilgramiraza]and include an return 0 at the end of the main ... (by BHX)
Compound Interest
 
Hi, I am making a program that calculates compounded monthly interest. I ask for the initialbalance and the number of months that it will be compounded and ask ...
[1 reply] : 1/12 is an integer expression, and so uses integer division. 1/12 == 0... (by helios)
Understanding Operator Overloading
 
Good day all, i have been battling to understand the overloading of the equality operator, please see code snippet below I have the following interface ...
[3 replies] Last: Reference. Your Word::operator== takes a reference parameter. The 'r... (by keskiverto)
What do these errors mean?
 
I'm getting weird errors I don't understand with this program. This program is the second part in a three-part assignment. So it's not meant to work, but it I...
[2 replies] Last: Ahh, alright I see. Thank you very much! Those are very helpful. (by VisuAlly)
by mehak
structure
 
shouldn't be the output be a garbage value? #include<iostream.h> class India { public: struct Bix { int x; float y; voi...
[5 replies] Last: Aha. (by cire)
Multiplication Through Addition Function
 
I am trying to create a function called square() that will multiply a given integer through addition. This is an exercise in my book. Help is appreciated. ...
[12 replies] Last: No problem (by Jamerack)
site
 
guys i found a website for c++ tutorial. is this good ? http://www.learncpp.com/
[1 reply] : Let's just all not reply, so he takes the time to read before asking u... (by TheToaster)
Template problem! expected initializer before '<' token (Solved)
 
I am trying to make a calculator program and I am getting an error when I try to define a function from a class template main.cpp #include <iostream> ...
[15 replies] Last: Oh.. now I get an error. Fixing now, thanks :) (by TheToaster)
by sjabat
inventory program
 
PLEASE HELP ME FILL UP THE REST. I DONT KNOW WHAT TO PUT INSIDE THE WHILE LOOP THE FIRST WHILE LOOP: THE USER SHOULD ENTER THE INVENTORY.TXT WHICH CONTAINS (H...
[4 replies] Last: Well, first open the file with ifstream input("inventory.txt") tr... (by TheToaster)
August 2014 Pages: 1... 2526272829... 40
  Archived months: [jul2014] [sep2014]

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