Beginners - December 2012 (Page 38)

Default Value?
 
Hi i am making a program that will ask the user to enter in a price for the days that they shopped on the 12 days of xmas. my question is, what if the user did ...
[2 replies] Last: Thank you for responding. For example after the day 1. cout << endl <... (by micahcujo)
Problem with linear search
 
Hello everyone, I am a beginner in C++. I am trying to practice my understanding about the linear search algorithm for array. I encounter two problems in this a...
[2 replies] Last: Thank you Pulse. You helped me a lot. I will take your advice. Have a ... (by domanhtien2011)
class problems
 
I am getting multiple errors,the first is in int main under switch case 4, it says meter must have a point to function and i have no idea what that means or wha...
[3 replies] Last: Do you mean you tried this but it didn't work: cout << meter.getg... (by Chervil)
by ft95
'cout' : undeclared identifier
 
Why this error? Error:error C2065: 'cout' : undeclared identifier #include "stdafx.h" #include<iomanip> #include<cstdlib> #include<ctime> using n...
[2 replies] Last: oh,sorry. thank you!!!!!!!!!!! (by ft95)
SFML moving character in a window trouble
 
The problem i am having is that when a key is press and held, the character will move, stop, then move smoothly. Its like it you hold a key when your typing. Th...
[1 reply] : Incase anyone else ever has this problem, the problem is that the sf::... (by nano511)
by robman
Program isnt reading values correctly (only in some circumstances)
 
Hi, Im very new to c++ and I have to make a program for a uni project... I managed to wing my way through most of it, and I thought it was working until I came ...
[7 replies] Last: Part 2: void outputs (int n) { tension_parallel = (0.6*bending); ... (by robman)
Loop going crazy
 
thanks i got it.
[2 replies] Last: I removed it and it still starts at 347 212 0419 instead of my first n... (by bainofmyexistance)
by A C
Go Fish
 
Hey guys I need to write a go fish program in C++ but I have difficulties to do so. Can anyone help me with some code that I can use? Anyone thanks for the help
[2 replies] Last: Agreed (by SamuelAdams)
by dcftci
problem in initializing an array
 
I tried to initialize an array in the constructor of my class. here is how it looks. MyClass::MyClass(double**arr, int N,int d) { firstd=N; secd=d; arr=new ...
[2 replies] Last: but I did set it to zero in the consructor (by dcftci)
pointer arrays
 
Hey i was messing around and noticed that when i do char* a = new char ; *a = 'h'; a++; *a = 'i'; a++; *a= '\0'; a -= 2; cout << a << endl; t...
[6 replies] Last: do you mean like this: string * temp_s = new string; *temp_s = "tem... (by chipp)
what am I doing wrong?
 
int find_length(int *A,int n){ int i,sum=0; int length; for(i=0;i<n;i++) sum+=A *A ; length= sqrt(sum); return length; } it keeps giving me this error...
[3 replies] Last: This will compile cleanly in C++11. C++98: length = std::sqrt( doubl... (by JLBorges)
by aminaa
explanation!!
 
class matrice { double *tab; unsigned lgn, col; public: matrice& operator=(matrice& m) { lgn = m....
[1 reply] : lgn = m.lgn; This sets the value of the class member variable lgn equ... (by Moschops)
by dcftci
class functions using a file
 
class firstt { public: firstt(); void generation();//generates int array int charintconverter(string filename,int mid);//finds the middle integer voi...
[no replies]
Cin Ambiguous
 
What does this mean??? At the end of my code, I hover over cin.get() (which is what I use to pause my program. AND YES! I know it is not the best way but this ...
[1 reply] : Did you declare your own global cin ? Does it work if you write std:... (by Peter87)
by Z feng
Access to a private member of a class
 
This is part of my class: class course { char name ; char term ; int units; char grade; course*next;//I don't know how to access to this one public...
[11 replies] Last: You could also overload the NextCourse() function, one returns a Cours... (by Volatile Pulse)
by Zoq
Testing if a number is an integer
 
I have searched for quite some time now and I cannot figure out how to input a year like 2000 and divide it by 4. Then test to see if it is an integer or a floa...
[5 replies] Last: Alright thank you guys. I got the program working. And i learded what ... (by Zoq)
visual c++ 6.0 error on win7
 
im using visual c++ 6.0 on win7, when i press ctrl+f5 it said "one or more files are out of date or do not exist. Would you like to build them? ", can you show ...
[1 reply] : You simply press yes. I believe, I don't use MSVC++, that pressing CTR... (by Volatile Pulse)
BST not printing
 
Hi again guys, I am trying to print out some items that I inserted into my Tree, but for some strange reason nothing is printing. . .Here's my code: #incl...
[9 replies] Last: The language itself isn't. Logically thinking about taking what you kn... (by Volatile Pulse)
Computer Guesses Number in Game - Not working, why? No debug warnings..
 
#include <iostream> #include <string> #include <ctime> using namespace std; using std::string; int main() { srand(static_cast<unsigned int>(...
[7 replies] Last: One question, are the comments "Needs to go lower" both supposed to s... (by Volatile Pulse)
by A C
What is wrong with this program?
 
// The game of Go Fish public class GoFish { public static final Scanner INPUT = new Scanner(System.in); // For reading from the console p...
[2 replies] Last: Yes I know. Thanks for the advice. I am just an enthusiast programming... (by A C)
December 2012 Pages: 1... 3637383940... 65
  Archived months: [nov2012] [jan2013]

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