Beginners - September 2014 (Page 37)

Wrong output for second cout statement
 
#include <iostream> #include <cmath> using namespace std; int main() { double time; double g = 8.83; double velocity; co...
[1 reply] : (1/2) is 0 (1.0/2.0) is 0.5 (by LB)
Access Violation - insertionSorting arrays
 
I'm working on a homework assignment, for which I must do an insertion sort on an array of terms (term ), while keeping each element of a corresponding array (f...
[8 replies] Last: Hey that worked perfectly! That makes sense too, I always thought of t... (by Smallboy)
Boolean Variable array and Variable parsing.
 
Ok as far as variable arrays. I'm workign with Visual c++ and they have TextBox and Label as objects you can use for building forms. This is how I can succes...
[15 replies] Last: bool Bool1 = false; bool Bool2 = false; bool * const foo = { &Bool1,... (by nick050183)
my code isn't formatting in my file correctly
 
i have a project due in a few hours. the project was to take a file that had roman numerals and numbers in it and write a program that contained functions to co...
[5 replies] Last: The problem is this line if (line.at(0) != 'M' || line.at(0) != 'D... (by Yanson)
Namespace, What Is It
 
I am trying to learn C++ and am working my way through a Dummies book with that title. I am up to arrays and have noticed that most of the code examples have th...
[10 replies] Last: Just to clear things up: the reason I asked "What do you mean by 'comp... (by LB)
Beginner on Classes!
 
!!Can anyone help me out with this question so i can get started in writing a program for it... and this is what i have so far...... the question is.. Creat...
[11 replies] Last: Line 22: You're still not initializing feet. Line 29: Why did you... (by AbstractionAnon)
why put a reference in an "operator" when overloading an operand
 
Hello. I watched this lesson about function overloading(about increments) and I'm just wondering why he placed a reference before the "operator". What's the pur...
[2 replies] Last: First, know that what you have there is a very bad idea. I'll get to ... (by TwilightSpectre)
by Ardaos
how to use getline() properly and how to use strcpy with a string a const char*
 
I get an error when I try to use cin.getline(line). Also, I can get strcpy(line, tempString) to work. It says no conversion exists between sting and const char*...
[7 replies] Last: There are several compilation errors in the above code. Line 14 o... (by Chervil)
I am receiving a run time error
 
I am working on a homework problem and I am receiving a runtime check failure #3: the variable selection is being used with out being initiated. I am trying ...
[7 replies] Last: hackmattr, would I just put case 0: Sign = aries; cout <<"Aries\n"; ... (by tangren17)
Find non-numbers in a file
 
So I have an input file like: "1 2 3 4 A B C D" The vector contains only the numerical values since it is reading them in as integers. However, how can I...
[1 reply] : You may add something like this after the while loop: if(!inputFile.eo... (by coder777)
by EvE12
Loop test
 
Why the program exit before I can choose the mathematical operation? #include <iostream> using namespace std; int main(){ int num1 = 0; doub...
[8 replies] Last: nice one :) sorry for bothering you You aren't bothering me :)... (by mutexe)
Why is the output this? Please help, hurry..
 
why is the output = 9? #include<iostream> #include<conio.h> using namespace std; int main() { int b=3,c=8,i=0; for(i=0;i<=c;i++) { } cout<<i; ...
[4 replies] Last: is it because "012345678" are 9 digits so i=9? No. Well, not exactl... (by mutexe)
Hmm Cant get this right!!
 
Hey i am new to use C++... This is one part of my 200 line calculator and the problem is the Name... else if (x==4) {float bmi,h,w,age; char name , wat...
[1 reply] : Don't mix gets with std::cin . Instead use a simple std::string . ... (by abhishekm71)
Why isn't this string if statement working?
 
I could've sworn iv'e done this a million times #include <iostream> #include <string> int main() { std::cin >> reaction; if (reaction == "look a...
[5 replies] Last: Just kidding (by turtlesavage)
by asd182
pic32 printer programming
 
Hello, I am a newbie in pic microcontrollers programming. I've got SnadPIC pic32 starter kit with pic32mx795f512l. I need to connect it to a printer, and I hav...
[no replies]
Can someone explain this to me?
 
Write your question here. I was looking up code to be able to extract individual integers off a string of integers; I.E input: 400, output: cout << a << b <<...
[1 reply] : Modulus 10 will give you the rightmost digit. Dividing the number by 1... (by Peter87)
by Mahkus
No input files error??
 
Why am I getting a no input file error here? Shouldn't the code input values for the double linked list? 1 #include <iomanip> 2 #include <iostream>...
[1 reply] : Why am I getting a no input file error here? What does that mean? Li... (by coder777)
OOP
 
what is better in these two code in terms of oop http://codeviewer.org/view/code:43d7 or http://codeviewer.org/view/code:43d8
[2 replies] Last: so youre saying in the first one that it is like a normal function and... (by xenovia12)
How can I add intergers from a file and assign the sum to a variable in this program
 
Hello, I was wondering if anyone could help me with a small problem that I have. I am trying to write a code that adds the integers from a file, but I just don'...
[1 reply] : 1. while -loop http://www.cplusplus.com/doc/tutorial/control/ 2. How ... (by keskiverto)
Error: expected ';' before "cost"
 
I'm writing the code for a program to calculate the total cost of a meal at a restaurant and I'm pretty sure I have all of the code right except this last error...
[6 replies] Last: Apologies for my unnecesary duplication. (by closed account 48T7M4Gy)
September 2014 Pages: 1... 3536373839... 51
  Archived months: [aug2014] [oct2014]

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