General C++ Programming - December 2015 (Page 3)

by alexqt
Create a variable with type based on a value from a binary file
 
I need to get the data and set the type, with data type based on a specific value from a binary file. I don't have a problem with retrieving data from the bi...
[9 replies] Last: Thank you again JLBorge. Thanks to you too Cubbi. :-) Happy New yr! (by alexqt)
question about function pointer in classes
 
for example: class B { public: typedef void(*funcptr)(int); //typedef... funcptr sptr; void set_function_pointer(funcptr in){ sptr = in; } }; B*...
[5 replies] Last: > it is even faster... Not always. ... ----- g++ with libstdc++ ---... (by JLBorges)
Mid-Beginner C++ problem
 
In Python, I can use "in" to state that this is inside that. For example: if "this" in stringX; print ("yadadada") else print ("Sally mcSal...
[3 replies] Last: +Moschops Yes, that's exactly what I meant. +Chervil Thanks, that's... (by AgathonXXI)
by Azee
printer spooling
 
Can any one help? Description : Printers typically can print only a single document at a time and require seconds or minutes to do so. If more than one a...
[4 replies] Last: Then post under the job section and name how much you would pay for it... (by TarikNeaj)
Arrays in classes not working
 
So heres my code: #include <iostream> #include <string> using namespace std; class Planet_Database{ public: string PlanetNames = { "Earth", "Mar...
[2 replies] Last: Oh ya, code tags, ok, sorry and thanks (by BobbyT321)
having error in this code...
 
when I compile this code it gives error statment missing ; atline number 43..Can any one correct it for me. #include<graphics.h> #include<iostream.h> #include<...
[12 replies] Last: As someone said above, go back and check your includes. line 7 should... (by SamuelAdams)
dynamic allocation c++
 
#include <iostream> #include <string> using namespace std; class Mint { public: Mint(); Mint(int); Mint (const char* s); void displa...
[3 replies] Last: By the way, Mint::Mint(int n) uses i before it is initialized.... (by dhayden)
by xismn
What's going on here? Auto/constant expression/floating point
 
Hello, Can someone explain why the following snippet is erronous? namespace foo { const auto a = 2.0; } class Test { public: Test() {} const static int ...
[3 replies] Last: Workaround: namespace foo { const int ia = 2 ; const dou... (by JLBorges)
collision detection
 
hello i seem to get a error when trying to do collision detection with my pacman and ghost. here is the two methods from my main code: void Pacman::CheckGhostC...
[2 replies] Last: Your problem is here: int bottom1 = y2 + height1; (by dhayden)
Simple For loop not running!
 
Below is my code for a project I am working on. The code gets past the first two groupings of For loops and then says Windows experienced and error and terminat...
[5 replies] Last: Very helpful again! I am going through the tutorial now and try sample... (by SeanDon44)
by ACD
xMas.cpp
 
my first attempt using vectors! =P #include <iostream> #include <vector> #include <ctime> std::string cantBeSimpleNowCanIt(int); inline void mySleep(clock_t)...
[4 replies] Last: interesting xD the mySleep function worked for me http://codereview... (by cire)
Volumetric Fog Producing Weird 'Bands'
 
Hey guys, I've been working on my first proper 3D engine, and recently I decided to implement a volumetric fog algorithm (from GPU Pro 6, though you do not need...
[no replies]
Using fscanf
 
I have a .txt file which looks like the following (the real file has many more lines, but this will suffice for discussion of my problem): # mass,pressur...
[3 replies] Last: Here I used a class (or struct if you like) to hold the data for each ... (by Chervil)
Apply dos in C++
 
I want use dos command in c++ program.I use turbo c++ version 4.5. I used header file #include<cstdlib.h> and method system() but error. Please help me.
[2 replies] Last: http://www.cplusplus.com/forum/beginner/181793/ (by TarikNeaj)
Binary Help
 
Hello, I am currently in my last year of a four year computer science degree and I am taking C++ next quarter, so I decided to do some practice with this langua...
[3 replies] Last: Yep, this is the solution. Thanks very much. I can do pretty much all ... (by HiKenshi)
Pointer help
 
Hello there. Well i need to convert a float to void *. And later convert that void * to a float. But how to do it in c++? Thanks -Leandro
[7 replies] Last: #include <iostream> #include <string> #include <cctype> #include <fun... (by JLBorges)
need help ASAP in packing my program
 
Hey , i wrote a program in C++ , i want to send my program to my friend and he dont have visual studio on his computer when i sent him the EXE file it asked fo...
[4 replies] Last: Okay i found something who fixed the issue i reply cause u helped me s... (by lovecoding)
by magnet
Data type for multiple imported files
 
Hello everyone, I am interested in importing multiple (relatively large) files. The question is what type of structure should I use to store them. They all ...
[6 replies] Last: Many thanks JLBorges , it is very useful. I think I will create a spe... (by magnet)
Function for deleting pointers of the same general type
 
So I wrote this function to delete, N, amount of pointers of the same type. I was just wondering if this is valid? I checked for memory leaks using visu...
[6 replies] Last: No, no one likes because they're massively unsafe, and using them requ... (by helios)
Program to output zero point crossing
 
Good Evening All and Merry Christmas! I am currently working to produce a program to output the zero point crossing time of a sin waveform given a set of inp...
[no replies]
December 2015 Pages: 12345... 22
  Archived months: [nov2015] [jan2016]

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