General C++ Programming - October 2009 (Page 4)

Problem with input
 
Let says my defined an input as an integer but i key in an character. How can i convert it into integer?
[18 replies] Last: It becomes like this during the second loop. WELCOME TO ... (by nsw1216)
by gnugu
set of integers
 
hi i need a datastructer similar to a set (adding and removing elements) with the additional property that i can quickly find the maximum element. is there suc...
[4 replies] Last: thanks i missed the sentence Internally, the elements in a set are ... (by gnugu)
by lace28
Program crashing in optimized or default mode
 
Hi, My program is crashing only when it's compiled in optimized or default mode. It does not crash in debug mode. The cpu goes up to 100%, the memory increas...
[3 replies] Last: New facts: Changing the CXXFLAGS -O2 option in the makefile to -O1 ... (by lace28)
by nikman
loading from file
 
I have the following code to load data from a file. It works fine when just snackcarts is used. But when it reaches the else if line it goes into an infinite lo...
[no replies]
Integrating using c++
 
I have this program to integrate a polynomial. The user has to enter 6 integers. Here's what I have so far: #include <iostream> using namespace std; ...
[6 replies] Last: float v ; I am prompting the user to enter six numbers, or... (by jsmith)
by JamesB
2d Vectors
 
Dear All. I'd appreciate some help. I want to be able to write functions that can handle both 1d and 2d vectors being passed to them. I also want to understa...
[3 replies] Last: Here is a synopsis of vector: template< typename Tp > class vec... (by jsmith)
by JRevor
Problems with stl set, and Random numbers
 
Im making a program to generate random sets of Polinoms (which are stored using dynamic memory on the Polinom class). However, i'm getting stuck on a forever lo...
[3 replies] Last: What does Polinom's operator< look like? You probably want to move ... (by jsmith)
getline function prob
 
I am trying to input a line of data using getline(), but i have enter twice after each getline function. Any idea on it . Here is my source code below. #inclu...
[5 replies] Last: Fixed the probs. Act is not my source code prob. there is a bug on the... (by nsw1216)
undeclared declaration in friend class
 
Im getting an error while overloading << that "cur" is coming up undeclared.I know that the function code is right. i just dont know what my problem is. head...
[2 replies] Last: thanks dude,worked perfectly. (by kakashi316)
compiler warning
 
i got this warning: 7 F:\373\LList.h friend declaration `std::ostream& operator<<(std::ostream&, llist<itemtype>&)' declares a non-template function 7 F:\373...
[1 reply] : The function must be preceded by the same template stuff as is your l... (by Duthomhas)
How to print out line input includes whitespace
 
I have facing a problem on get a line of input with whitespaces inside. How can i solve this problem. Here is my source code. #include <iostream.h> #include ...
[19 replies] Last: I have a problem about the getline(). Why my 1st input will goes to th... (by nsw1216)
expected unqualified-id before ""
 
Im getting the error expected unqualified-id before "delete" for a program that im working on and i have no ieda what to do for it.any help would be appreciate...
[8 replies] Last: thanks i fixed it (by kakashi316)
by JamesB
memcpy with strings
 
Dear All, I'm very new to C++ (2 weeks at present) and could really do with some help. I'm using the following template <class arr, class elmt> void ins...
[4 replies] Last: It's a function it's a function that's only called from one function, ... (by helios)
linked list error
 
Im trying to write a program to make a generic linked list but im coming across some errors. header: #ifndef LLList.h #define LList.h #include <iostream>...
[9 replies] Last: missing semicolon line 7 and 14; #endif on line 30 should be at EOF... (by jsmith)
by Null
Export
 
Hello, I have few questions regarding C++ export keyword 1. Why compilers don't implement it? 2. How to use it? 3. On Dev-C++ _export and __export keywor...
[1 reply] : Double post: http://www.cplusplus.com/forum/general/15691/ (by Bazzy)
by Null
Export
 
Hello, I have few questions regarding C++ export keyword 1. Why compilers don't implement it? 2. How to use it? 3. On Dev-C++ _export and __export keywor...
[1 reply] : 1. http://www.network-theory.co.uk/docs/gccintro/gccintro_61.html 2. ... (by Bazzy)
by nrose
how to control how many characters are printed per line
 
my prof wants us to write a program that accepts positive integers and a character input then when the program outputs what you entered there are only 10 charac...
[5 replies] Last: already got it running thanks for your help (by nrose)
question on arrays
 
hey guys, i was trying to make this simple program using arrays.. we are supplied with a text file called data.txt.. in the same directory as the program.. the ...
[3 replies] Last: I tried to do it how you were laying things out. This isn't everything... (by Mythios)
for loop
 
i need to print however many characters i input for my integer but with only 10 characters per line. I'm not sure how to get it to work... int main () {...
[4 replies] Last: I now have a new code but the only problem now is that it won't print ... (by spazamatic2)
Checking if two vectors are equal.
 
I haven't actually wrote anything for this yet but I'm just wondering the best way to go about it. Say i have a Vector2: class Vector2 { //Not goin...
[10 replies] Last: Not really sure what your getting at there... not sure at all? (by Mythios)
October 2009 Pages: 123456... 17
  Archived months: [sep2009] [nov2009]

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