General C++ Programming - January 2013 (Page 5)

How do you store the entire content of a file in a variable?
 
I would like to store the entire content of a file in a single c-string variable or in a standard string class variable. Is there a function that will do this ...
[4 replies] Last: Yes Cubbi. That seems to be exactly what I need. Now to understand t... (by rjschilling)
by Balrog
OpenGL Window and Texture Errors (SOIL)
 
I've been getting a really strange bug in my project ever since I ported it from XP to 7. What happens is that it'll execute, but only display a black box if ru...
[no replies]
by mobat
Am I writing my code efficiently?
 
I started writing a base to a text base adventure game and I was wondering since I am pretty far in that if I am writing the code correctly and efficiently. I w...
[5 replies] Last: If you have a few bucks left buy "Design Patterns" by the Gang of Four... (by closed account D4S8vCM9)
it is not working on windows. i am unable to find the error!!
 
#include <iostream> using namespace std; class ratio{ public: ratio(int n=0, int d=1): num(n), den(d) { reduce(); } void print() const {...
[2 replies] Last: Thanks a lot !! (by newbie456)
template function parsing - what's going on here?
 
template< typename TYPE > void Foo( const TYPE & foo ) {} int main ( void ) { const int* bar; Foo<int*>( bar ); // error: no matching function...
[6 replies] Last: [quote=caibber]Templates aren't as powerful as I have been led to beli... (by closed account o1vk4iN6)
by rpod83
Weird memory problem, accessing certain data corrupts other data.
 
I am having a problem where within a heap-allocated object, a function is called that does some manual data copying, essentially copying the contents of one buf...
[1 reply] : > what kind of thing might create this problem. accessing out of boun... (by ne555)
Writing to File Problem? [Noob Here]
 
Hi guys, I started learn c++ about 2 or 3 days ago. I'm getting the hang of the easy console stuff. I am running into an issue here though. So I'm trying to ...
[9 replies] Last: @ModernBacon Ignore joneele. He doesn't know what he's talking about ... (by joneele)
Search for User Control
 
I am in need of a "Virtual Joystick" user interface control for Visual C++ under Visual Studio. Has anyone heard of such and animal?
[no replies]
Small bug in code
 
hello all, I believe there is a small bug in my code because of this the segA and segB sizes when I call from main() are incremented by 1 due to which my out...
[no replies]
by Musi
Finite State Machine/ State Pattern
 
I've been trying to make my first game but I'm having trouble just setting up the basic game states. I don't want to use enum's and switch statements so I'm hop...
[4 replies] Last: considergoogleing scene graph. http://en.wikipedia.org/wiki/Scene_gra... (by pogrady)
Hangman
 
I'm a beginner in programming, just started to work in some projects and one of them is a "CANT WIN HANGMAN GAME" and need help finishing it. This is what I hav...
[3 replies] Last: Better to create public GallowsPole::draw() method which will call dr... (by MiiNiPaa)
Calculate the start of a row in VGA VRAM?
 
How do I calculate the start of a row (e.g. row #0, #1 etc.) in the VGA's VRAM? (On a planar level) So if I need to get row #13 on plane #0, with an offset reg...
[no replies]
c++ program which adds text onto an image
 
Hello I want to create a program using c++ which will accept text from the user and then adds it onto a image of a form in specific locations (if that makes ...
[1 reply] : For that stuff, I am using QT Framework. Never worked with other libra... (by geforcefan)
Allocation/Deallocation problems
 
Hallo Guys, Since days, I am trying to figure out my "allocation/deallocation" problem. Its simple: I have a class called "Mesh". This is used for my OpenGL ...
[10 replies] Last: Thank you for your link. I am at the work at the moment, I will try i... (by geforcefan)
by J4ke
GLUT Cursor Problem
 
Hi. I'm new to the forum, but I have been programming for about three years. I was making an OpenGL game and recently came across a problem. I am making a fi...
[1 reply] : try this: void mouseMovement(int x, int y) { int diffx = x - (glut... (by geforcefan)
by vijkrr
returnint char*
 
Hi, I need few clarification in returning pointers.. Assume a common API char* itoa(int); If I want to write a same type of funciton, I need to retu...
[2 replies] Last: As described by @kbw above, the itoa function provided by the standard... (by ajh32)
by aj3423
problem implementing getter/setter
 
Hi, I'm implementing a property class for gui library, just like property in vb for example struct window { property::rw<string> title; ... }; ...
[2 replies] Last: Tanks a lot, what a stupid mistake. (by aj3423)
File I/O in a Visual C++ GUI
 
Hi everyone, I've been trying to figure out how to make, for example a button in Visual C++ that can take some text from a textbox and save it as a file. But ...
[1 reply] : This is what I would do in Qt: 1. Create the button with the GUI tool... (by Stewbond)
program 1
 
An instructor needs you to write a program that will compute the final average grades in her class. There are 5 students in the class. Each student must take 2 ...
[1 reply] : so you just post the question and dont even add any of your own words?... (by gtm)
code
 
I want this program to press ctrl+alt+z , but it does not :| What's wrong ? #include <windows.h> #include <stdio.h> #include <stdlib.h> int main() ...
[2 replies] Last: even if that code worked the pressing would be virtually instantaneous... (by gtm)
January 2013 Pages: 1... 34567... 36
  Archived months: [dec2012] [feb2013]

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