General C++ Programming - August 2014 (Page 13)

Void* cast to STD::string, output wrong...
 
So hopefully this is a simple question... I have (assume all the right H files are loaded): typedef void(*function)(void*); std::map<std::string, function> ...
[6 replies] Last: You'll almost never need that kind of power. Something like this is mu... (by helios)
Mingw does not support C++ 11?
 
Hi, I am using the Mingw compiler but this code does not work #include <iostream> #include <memory> using namespace std; int main() { shared_pt...
[9 replies] Last: Yes. (by Duthomhas)
vector subscript out of range
 
Hello, I keep getting this "Debug Assertion Failed" error that says: expression: vector subscript out of range I tried to make the loop the same as the vec...
[3 replies] Last: grid_ is probably never initialized. Lines 71 and 72 either crash, or ... (by helios)
Ternary Op
 
Just would like some quick clarification on the ternary operator. The book i have doesnt cover it. I just wanna see if a number is Neg or Pos and spit back nega...
[3 replies] Last: Thank you both i appriciate it! (by LovestoCpp)
Difference between ofstream and ostream operators
 
Hi, I'm trying to overload an operator << so that it prints to a .txt file. Would these two codes basically do the same thing? If so, which one is the more ef...
[2 replies] Last: Oh, that's awesome! Thanks. (by tybalttheappleEater)
Unique pointers?
 
Hi, I am new to smart pointers so I want someone to clarify that the memory will be deleted after the program loses scope. const char* query = {"SEL...
[3 replies] Last: [quote=codekiddy]yes, as soon as unique_ptr goes out of scope it's d... (by LB)
Linker issues with my own class.
 
Okay so I have my main function (WinMain) which declares a pointer to a class that I have included the header file of and uses some of the functions within the ...
[16 replies] Last: Creating a new project, copied over all the files and included them in... (by thefatshizms)
[SOLVED] Collision Detection Doesn't Work
 
EDIT: I've downloaded the box2d libary and i'll start using it , i'll follow the tutorials for it on youtube as i saw it has all i need to work properly, so no ...
[no replies]
How do I know if the classes in my program are being used?
 
In this program the intention is to create a menu driven program for a pizza restaurant. I have to use a class called Pizza and have to include at least three p...
[8 replies] Last: Cool thanks man, I'll definitely look into get functions. (by rosales5)
Which is the best idea?
 
Hi, In my game I am making their are these things call item windows. At the moment you call the game class to add an item to the window. Like so case 11:...
[no replies]
Casting problem?
 
Hi, The compiler is returning a warning 192|warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]| My buffer is a char arr...
[2 replies] Last: My online game required a stream so I wrote a stream class. Their is a... (by danielmccarthy)
Undefined references OpenGL on Ubuntu 14.04
 
I am trying to compile an OpenGL program in Ubuntu. This program opens a blank window. Code: #include <GL/glew.h> #include <GLFW/glfw3.h> #include <cs...
[6 replies] Last: -lpthread, however order of libraries added is important. (by modoran)
Square Sums
 
Hi, I'm learning to program on C++. I want to declare a function to program this division of sums where I've two arrays having xi and yi terms respectively, and...
[2 replies] Last: Your code refers to col2 and col1 , which it does not know about. ... (by keskiverto)
Good modern OpenGL tutorial for 2D games
 
Can you recommend me a good OpenGL tutorial for 2D games? I want to use OpenGL 2.1 (no glBegin() , glEnd() and other deprecated functions). ...
[4 replies] Last: some are GLSL related and looks like glew doesn't check those, only t... (by memberfunction)
by judo11
How to display a pascal triangle using a 2D array in C++?
 
Guys how can i display a pascal triangle in forloop? Here's my code. #include<iostream> using namespace std; void print(int a ) { for(int r=...
[1 reply] : [quote=OP] 123 56 9 Are you sure that's Pascal's triangle ? L... (by a k n)
How does this linked list work?
 
I am currently learning linked lists and I cannot figure something out. Why don't i need to print the last element n->data after the while loop? Why is it print...
[2 replies] Last: Why don't i need to print the last element Because the last element ... (by dhayden)
VGA maximum resolution possible without memory restrictions?
 
What is the maximum resolution possible with the VGA's CRTC registers, provided that enough VRAM is available (>256K)? Would it be 1024*9*2 horizontal pixels, 1...
[no replies]
Reverting a Bitset
 
Hey there, You can create a bitset like so: bitset<16>((int)10); // or... bitset<16>((char)'H'); // or... bitset<16>((string)"Boosh"); But, there's ...
[3 replies] Last: Thanks for your help (by SixTsevN)
by Grpc96
scanf problem
 
Hello! When I am trying to compile, it says that it is done but when I try to run the program it says that it is not compiled. I tried to track down the proble...
[4 replies] Last: Yes I'm sure. I'll try to use code blocks if it will work. Edit: Ok i... (by Grpc96)
Anti-Patterns. Worth studying?
 
Just when I thought I had all the design patterns in my grasp, I come across this: http://sourcemaking.com/antipatterns/software-development-antipatterns which ...
[3 replies] Last: My goal is to write my programs using the best choice of design patte... (by dhayden)
August 2014 Pages: 1... 1112131415... 25
  Archived months: [jul2014] [sep2014]

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