General C++ Programming - September 2012 (Page 19)

by lmd141
Creating output file
 
Hi there, I'm currently writing a program that calculates the energy of atoms inside a simulation space (I'll spare the other details). Basically I want to crea...
[3 replies] Last: 2 options: 1 - You can open and close file 1 and then open and close... (by soranz)
by sdj
Pointers in cpp
 
I saw a pointer which was declared as *& in a program... what does *& represent?
[3 replies] Last: @ pogrady : You cannot dereference a reference. As Caligulaminus sa... (by closed account zb0S216C)
Sorting 2D Vector
 
I am trying to use the std::sort included in algorithm library but keep getting errors... WBMovies.h #ifndef WBMOVIES_H #define WBMOVIES_H #include <iostream...
[7 replies] Last: Well if you have several members of type std::vector<T> in your class ... (by vlad from moscow)
Can't get a math equation to work. Help :)
 
#include <iostream> #include <stdlib.h> using namespace std; int main () { int midterm; int final; int researchPaper; int groupProject; int pa...
[5 replies] Last: Found it. I had researchPaper2 = researchPaper/250 rather than 150. (by x Goliath x)
by jorgen
Binary files
 
Hello! I'm trying to learn how to use binary files instead of text files (supposedly they will take up less space?) and I have the following small test program:...
[10 replies] Last: That worked, thanks a lot! (by jorgen)
Pure Virtual Functions
 
Hello all, Say I have an inheritance tree, and I want to not be able to create objects of the class which is near the top of the tree. I could have a pure vi...
[6 replies] Last: OK thanks Vlad & Doug4 - it works like a charm. I used the protected c... (by TheIdeasMan)
by jorgen
Function pointer and ofstream
 
Hello! I'm trying to create a function pointer to a member of std::ofstream and get an error. Here's the code: int main() { ofstream bout; bout.open("...
[3 replies] Last: Haha! Thanks guys (by jorgen)
basic c++ program
 
hi, can anyone explain the o/p of this program. #include<iostream> using namespace std; int main() { int a=10; cout<<a<<" "<<a--<<" "<<--a; return ...
[8 replies] Last: The link that @tolga gerekci provided sums it up pretty well. As far ... (by doug4)
Having an issue with <fstream>
 
This is the code. The compiler (Visual C++ 2010 Express) does not recognize the ifstream and ofstream even though the <fstream> header file is included. I hav...
[4 replies] Last: Another way is to write std:: in front of all the names from the stand... (by Peter87)
by Eyad
2D array
 
How can I output 2D array (8*8) but in order? 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 45 46 47 48 49 50...
[5 replies] Last: If I have understood what you want then you can use the following code... (by vlad from moscow)
HOW DOES ONE PASS AN ENUM TYPE AS A PARAMETER FOR A CONSTRUCTOR
 
Hi everyone, My class below contains two enum types. My problem is passing an enum parameter to the constructor. I'm not really sure how to do that. #ifnde...
[1 reply] : Entertainment movie_1("89564", "Apocalypto", "Mel Gibson", 2, date, E... (by firedraco)
by CMarco
size vector in c
 
Hello, I'm trying to create in C something like this: struct ne{ uint64_t shw; uint16_t th; }; struct ne *ret ; It gives error sa...
[8 replies] Last: ^ man malloc (by ne555)
Should I get Stroustrups book on Programming: Principles and Practice Using C++?
 
I can get it at close to 50% off (for $42) :D I am already getting C++ Primer 5th ed by Lippman for C++11, and the 2nd ed of C++ standard library by Josuttis (...
[5 replies] Last: +1 JLBorges. (by Catfish2)
Moving from SDL to qt for graphics
 
I'm fairly used to the paradigm in SDL of changing the location of an object and then redrawing everything. Is this the same in Qt? At the moment I have a...
[2 replies] Last: Thanks for sharing knowledge. http://www.editableclips.com/ (by editableclips)
by mika23
Stack compiles but postfix output wrong
 
Hi guys so my stack program I am supposed to enter a postfix empression like 37+. It only outputs the first number 3. Another example 542+* it will only output ...
[1 reply] : You need to post some code, otherwise we can't help (by coder777)
Best socket lib in c++
 
Hi, Can some one suggest the best framework or toolkit/sdk/lib for sockets in c++. I need to use it to build a server, initially the server is for Linux/u...
[3 replies] Last: These are the options that come to mind immediately: Boost Asio - pro... (by JLBorges)
SFML Window Problem
 
So, I'm learning SFML (done with SDL, just not for me) and I've run into a very minor problem. So, if I have a function called init() that handles creating t...
[2 replies] Last: Sorry, I rushed and didn't write all the details in :X You are correc... (by tannerwilson)
by vw4x4
please explain
 
can anyone explain me the advantage of type casting over type conversion?
[1 reply] : type casting is type conversion. (by Disch)
Does anyone know of a free library that allows you to play audio files
 
I would want to add sound to the program like in the video. http://www.youtube.com/watch?v=2-am2t8-HCk
[4 replies] Last: OpenAL (open audio library) ? (by closed account o1vk4iN6)
Fixing the bugs in the program that happened when creating the functions.
 
Can you help me fix the code. #include <iostream> //NAMESPACE using namespace std; //MY VARIABLES long a = 0; long b = 1;//never changes ...
[3 replies] Last: <brandonator> you cannot have a variable and a function named the same... (by CLman94)
September 2012 Pages: 1... 1718192021... 32
  Archived months: [aug2012] [oct2012]

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