Beginners - February 2011 (Page 9)

importing numbers 1 by 1 in a 2d array
 
Hi all, I have a working code here for importing numbers from a .txt file, one by one into a 2d array. #include <iostream> #include <fstream> #includ...
[no replies]
Do not count multiple spaces as words
 
I'm making a program that counts the number of words from a user's input. So far, it works but only if the user inputs one space between words. Otherwise, the p...
[4 replies] Last: #include <iostream> #include <string> #include <sstream> // added ... (by mikeofthenight)
C++ troubles
 
#include <iostream> #include <cmath> // for abs function using namespace std; // ---------------------------------------------- // Functio...
[1 reply] : you don't ever return anything from find_root. (by hamsterman)
by tonnot
A case of forward instancing, how to know if the object were created?
 
I have at my prog.h file Class tha_class; .... private: Myclass *the_class; And later at prog.cpp, I have a function that create the instance: ...
[1 reply] : have it point to 0. you should have all unused pointers point to 0. u... (by hamsterman)
by tonnot
Can't use Char buffer with strpbrk function ?
 
I have a fstream instance to read data from file. And I keep on very confused. BIN_BUFFER = new char ; (declared as char * BIN_BUFFER ) FILE.read (BIN_B...
[2 replies] Last: aaarrggssss ! Thank you (by tonnot)
Math arc length and points
 
Lets say I have a circle. radius = 16 center is point 0,0 i have 1 point on the circumference of the circle. i know the angle to the point. i know the x a...
[3 replies] Last: L/r = angle in radians? Yes. To find a point on the arc, you can... (by matsom)
by tonnot
Urgent ::I can't define a function to accept "" or NULL
 
I have myclass::operator << (std::string data) {} myclass::operator << (const char * data) {} myclass::operator << (bool data) {} Ok , if I call cl...
[3 replies] Last: Why do you call class<<NULL ? If you have a char pointer you can chec... (by Bazzy)
Passing structures to a function [need assistance please!! D:]
 
I'm really lost on how to pass my structure to a function. Basically I have the listed structures, and I need to pass them to a function for conversion. Can ...
[9 replies] Last: You don't need to use pointers. You can pass it by (const) reference i... (by Bazzy)
ceil not working?
 
I cannot get this program to round the amount of gallons up to the nearest integer for some reason while using the ceil command inside the function FindGallons,...
[4 replies] Last: now it's telling me that in converting from an int to a double. //... (by nekoxandu)
Point me to the right direction (no pun intended)
 
I am trying to create a program that would collect the number of students and movies for each student. The program will then dynamically allocate it and calcula...
[13 replies] Last: Thank you :) (by SFX9901)
by shan03
Linker error?
 
This s my code..I am using dev c++ compiler....I got the following error... [Linker error] undefined reference to `err_handler(void*, int, int, int, char...
[1 reply] : You need to link against the library that offers you the function err_... (by Zaita)
Struggling with program using functions, vectors and sorting.
 
I've been assigned the following. Task #1: Define a struct type called Student. A Student has the following members: • last name (a string) • first na...
[3 replies] Last: Student LIST ; cout << "How many students are in the class?" << ... (by Zaita)
cin statement being skipped
 
I'm trying to validate the input of this double price variable. If the input is invalid, i.e. "string" or other non-numeric characters, it goes into an infinit...
[3 replies] Last: Cool, thanks guys. Another one down. (by pelotron)
cin char and spaces ' '
 
So I have run into this problem a few times in class lately. I have found one way around it but wanted to see if anyone could provide a little better informatio...
[3 replies] Last: There is also the noskipws manipulator. (by Duthomhas)
by tonnot
A strange behavior of overloaded operator '<<'
 
if have : myclass& operator << (std::string data); myclass& operator << (bool data); Ok I dont know what can be happen, but myclass<<"hello"; is proce...
[4 replies] Last: Likewise, you need to qualify all your argument types with const . ... (by Duthomhas)
New to C++, code written, look at code 4 me?
 
Like the title says I'm a student, new to C++, I've written this app that plays this flippin rock, paper, scissors game but when you run it you have to type in ...
[5 replies] Last: Awesome, thank you very much, I appreciate the help. It looked more c... (by turbowhat)
by tonnot
How to process a few << << << operators as one ?
 
How can I do that ? I want to do for my function the same as cout <<"hello" << a_string << "how are you"; But every << are processed individually. ...
[2 replies] Last: If you want to have all the data delivered at the same time, you can u... (by Bazzy)
namespace and includes causing compiler issues.
 
I am trying to compose a 1 dimension function evaluation tool for a school project. I am pretty new to C++ and am getting some compiler errors. Function1D.cpp...
[4 replies] Last: It's going to be the same deal as before, you need to include Function... (by Roastern)
Variable being used without initialized
 
// David1 // Lab 14. This program takes user input and assigns // appropriate values to the sides of a triangle. #include "stdafx.h" #include <iostream> ...
[4 replies] Last: Oh, Awesome! Thank you so much! (by daveofva)
Did I do something wrong?
 
Calculate the product of odd integers 1 to 10 using while loop and display result. #include <iostream> using namespace std; int main() { int count =...
[7 replies] Last: If you want to make this program to work, just swap line 14 with 15,... (by TJbla2e)
February 2011 Pages: 1... 7891011... 43
  Archived months: [jan2011] [mar2011]

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