General C++ Programming - March 2011 (Page 10)

by Disch
Saving floating point as binary
 
What are you guys recommendations as for a way to portably save floating points as binary? The obvious approach would be to just cast it and dump the binary ...
[1 reply] : Unless your binary file format specifically indicates how your floatin... (by Duthomhas)
Deleting a node with a certain value
 
I'm writing a program that creates a lists of bikes from a file. Currently, I think I have everything correct up to the sell one bike function. I'm getting some...
[2 replies] Last: Thanks for the info ne555. I've made some changes to my program but I'... (by skatingrocker17)
n choose k
 
I can generate all the possible ways to choose 3 things out of 6 things with the following code (order doesn't matter here). for(int i = 0; i < 6; ++i){ ...
[2 replies] Last: This solution should work, at least it did when I went through it on p... (by Deviouscola)
SFML segmentation fault when calling sf::RenderWindow::Clear()
 
Title says it all. I'm encapsulating SFML in a class and making some widgets for a basic GUI library that can be used in games. However, when I call sf::Render...
[4 replies] Last: I re-compiled and re-installed the libraries and it works. I guess the... (by chrisname)
Serious Problem With Arrays
 
Here's the code. using namespace std; int main() { char b, d; char item_type; int s; int amount; char inventory ; ...
[8 replies] Last: I have a feeling you started with BASIC... no self-respecting programm... (by packetpirate)
by mxs
Occasional Pointer Failure
 
I’m making an Asteroids game and to handle collisions between objects, I’m storing them in a vector. I then loop through the vector of objects, check them ...
[10 replies] Last: I’m sorry, it’s quite a large chunk of code which would require a ... (by mxs)
Array Problem
 
Look at the following code. When it gets to the second switch (enter amount part) I run into a problem. When I input item type 1 or item type 3 it works fine. W...
[1 reply] : Please don't post duplicates. http://www.cplusplus.com/forum/general/3... (by kbw)
stringstream and numbers
 
The code below will explain better what i want: #include <iostream> #include <iomanip> #include <sstream> int main() { double num0 = 541.4; double num1 = 5...
[2 replies] Last: That's it, thanks. (by savavampir)
by uTil
infinite linked list
 
Hi, I made a post like this in the Beginner section and wondered if the content was appropriate. So regardless this is regarding an object I've created to store...
[9 replies] Last: Your linked list is made up of nodes allocated on the heap. But that ... (by kbw)
Interesting Problem with multiple File I/O
 
I am experiencing a problem reading in from files. myfile1.open("File1"); if (myfile5.is_open()) { while(!myfile1.eof()) { myfile1>>var1; myfile...
[7 replies] Last: Yep. I just noticed that. Thank you :) (by leezardking)
Using a constant class variable
 
I have this array of "Table" objects. Table tables ; Inside this object there is this constant variable const int maxSize; The constructor looks as foll...
[3 replies] Last: not quite like that no, firstly you'll have to return a Table object, ... (by quirkyusername)
Prime numbers from 1 to 100
 
Hey there, need some assistance. I want to print out prime numbers from 1 to 100. I've created a program but the output is this. 5 7 11 13 17 19 23 25 ...
[6 replies] Last: this is for all the prime numbers. (by waleeds37)
inFile with an if/else
 
I am new to C++ (currently taking it in school) and I have actually been doing well up until this point. But now I am conused and I am hoping someone can help....
[4 replies] Last: getline(infile, studentName); infile >> ws >> studentYear; infil... (by closed account zwA4jE8b)
post-fix calculator input problem
 
Hello, I'm trying to make a post-fix calculator with stacks, And im running into problems with the input, The method I'm showing here is the way I want to do it...
[3 replies] Last: OK. The only problem I see with your code so far is that you won't pa... (by PanGalactic)
Event callback on a deleted object instance.
 
Hello, I'm facing a new issue with my event library. Almost all is working very well by now with that lib, but today I faced a problem I did not anticipated : ...
[1 reply] : What you need are managed pointers, and something like boost::shared_p... (by jsmith)
uncertinity regarding technology..
 
Hi Guys This post is regarding the dilemma in my professional carrier.. I am a VC++ programmer and the areas in which I have worked in the following areas...
[7 replies] Last: ok buddy thanks a lot ... (by Nov Programmer)
Need help with vector writing in/out. I've been working for hours!!
 
Here is my code. This part works. It accepts the string and writes it to the file #include <iostream> #include <string> #include <vector> #include <fst...
[1 reply] : Well This makes things easier class UserPw { ... bool operator==(c... (by coder777)
cant load msado.tlh
 
I cant seem to make this statement work in a header file : #import "msado15.dll" Ive also tried the full path to msado.dll. Ive tried to clean the solutio...
[7 replies] Last: Thanks for posting the fix. (by kbw)
by pizet
trouble with processing input
 
Hello. Let's say, that I have N lines of input where on each line are from 1 to K integers. I have a bit trouble with reading this input correctly. ...
[5 replies] Last: Use a vector to store the data. If lines are important, then use getl... (by firedraco)
metric conversion
 
pls i need an assistance in coding a program 2 perform temperature conversion (celsius - fahrenheit). Anybody with idea on how 2 do this?
[1 reply] : What do you have? (by firedraco)
March 2011 Pages: 1... 89101112... 31
  Archived months: [feb2011] [apr2011]

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