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

Read integers from file only once
 
Hi! I want to load numbers from a file, but every number only once. An input, for example: 1 2 2 5 1 7 I want to store: 1 2 5 7 Here's what I've done ...
[5 replies] Last: Finally, I've managed to finish this, here's the solution, if someone ... (by tombali)
by Giri89
'For Loop' skipping over 'Switch' statement
 
Hi Everyone, The below code seems to be skipping over the Switch statement. I have left a comment next to the "problem" area. Thank you! Kind Regard...
[3 replies] Last: Thanks so much guys!! Kind Regards, Giri (by Giri89)
Which Curses Library?
 
I am in indecision about which Curses library to use. I don't really know the difference from any of them, but I read that ncurses in cross-compatible, which is...
[6 replies] Last: Don't wanna be rude, but tl;dr. But in my time dawdling the internet b... (by closed account 967L1hU5)
Tree Menu Implementation
 
Hi i need to create a menu for my binary tree its a meny for clothese Sports Clothing Menu: 1 Soccer 2 Rugby 3 Add a new category 4 Add a Sellin...
[no replies]
binary saving not working
 
Hi, I just started c++, still learning around. Really need some help. I've tried all means and ways, and looked around alot on the web, but I cant seem to find ...
[no replies]
need some guidance.....
 
i got a file with some numbers for example 1234 and 3302 and i need to add 1+2+3+4 to equal 10 and lets say 3+3+0+2 equal 8. i got this while loop but how do I ...
[1 reply] : All I can recommend is reading a bunch of tutorials and maybe a c++ bo... (by markyrocks)
Problem with vector iterator. I think???
 
Hello. I am new to this forum. I have a problem with a program I am writing. I have narrowed it down to the following section of code as when I comment this cod...
[12 replies] Last: there was something wrong in my properties. thanks for the link ne555.... (by dsi2272)
struct name not defined
 
Hi, while i was doing an assignment for class to write a skip list i get a error telling me the struct Node isnt defined at one function while it works fine for...
[1 reply] : When you write down the return type, you're still not inside the names... (by helios)
by qazwsx
seekg() not working properly, sets the pointer in wrong places.
 
So, here's the code that shows what my current problem is. ofstream t; t.open(mainTape.c_str()); t << 1.0 << ',' << 3.1 << ',' << 1.0 << '|'...
[3 replies] Last: all ios_base::text does is translate line breaks. Whether your use io... (by Disch)
GPA calculator in c ++
 
calculate gpa of a student using if statements.
[2 replies] Last: void main() { while(true) { fork( ); } } ... (by ceruleus)
PLEASE HELP on programing a Craps Game
 
I have a assignment with these details may some one please help me on this?!? This is the assignment: The rules of craps are as follows (basic rules, not casin...
[2 replies] Last: I have no 3 Dimensional Dice, and I have no bet / hard way "system" bu... (by Azure ALTIMIT)
C++11 -- std::array
 
I'm having a little trouble understanding std::arrays, could someone give me an example? http://en.cppreference.com/w/cpp/container/array
[2 replies] Last: Thank ye! I think I like C++0x/11 ... for (auto i : array) { :D... (by strongdrink)
Static help
 
If I have a class with an ID and a static ID, which increments in the constructor of each object, How can I create an function that can get any object's values ...
[1 reply] : By storing the objects in a container and giving the container that pa... (by Athar)
by er2998
Help please
 
Trying to get the below code to reverse the entire input but it is only reversing the first word. ============================================ void Reve...
[1 reply] : cin >> MySentence; cin >> stops at whitespace. If you want to ... (by Disch)
Confusion about "delete this"
 
class A { public: int i; void f() { delete this; } }; int main(int argc, char* argv ) { A * pa = new A; pa->f(); // Question 1) A a;...
[4 replies] Last: new and delete operate on memory allocated from the heap. If you allo... (by rmsharkey)
by orxshi
Pointer to structure
 
Hi all, There is a structure: struct struct_cent_3D { ... struct sGrad { vectorize u; vectorize v; vectorize w; vectorize T; vectori...
[2 replies] Last: Disch, thank you for your help with instant messages. (by orxshi)
PD Curses Help
 
I am new to PD Curses, and am attempting to make a console program with it. I've looked online and in the .txt that came with it, but I couldn't find what I was...
[no replies]
by fkrafi
Compile C++ using cmd
 
I can compile following code using "cl A.cpp" but i want to compile with an input file A.in and generate output file A.out.. is there any why to do that from cm...
[2 replies] Last: I got the command, it is cl A.cpp A < A.in > A.out ... (by fkrafi)
how to check if a specific file extension exist in a text file using c++?
 
Hello i want to check if .txt extension is in the text file named directorycontents.txt which has all my contents of my directory listed in text of which is loa...
[3 replies] Last: That is what I'm suggesting. Read this link: http://www.cplusplus.com... (by kooth)
Help with functions and errors!!! PLEASE
 
/* PROGRAM: HOSPITAL.CPP Written by This program uses functions and calculates the total cost of a hospital bill after the user inputs their hospital infor...
[12 replies] Last: thanks for everything.. this has been solved.. it turns out our proble... (by jjb5314)
October 2011 Pages: 123456... 36
  Archived months: [sep2011] [nov2011]

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