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

by xzbit
repaint a window
 
case MY_BUTTON: hdc = GetDC (hwnd) ; SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT)) ; TextOut (hdc, 50, 130, L"1", 2);...
[4 replies] Last: Well, for the first attempt you may invalidate the whole client area. ... (by coder777)
by Zapeth
std::string gets destroyed before return
 
Hello, I have just implemented a few functions in a class of my program where some of them should return a std::string. In those functions I use a temporary st...
[5 replies] Last: I see, thanks for the thorough answers, I guess I will rewrite my code... (by Zapeth)
templates in two separate (.h and .cpp files)
 
Hi every one. I am stuck in a difficult problem and really need its solution. The problem is in these three code files: First File: .h file Second File: .cpp f...
[3 replies] Last: The template code has to be available when you use it. If you want to ... (by Peter87)
by OSKG
Trobleshoot Write to ext file
 
I am trying to write to external file in GCC. So far I can get to this: #include <iostream>; #include <fstream.h>; using namespace std; int stream (int a...
[2 replies] Last: I want to write Binary to file I want to place it and end of line I wa... (by OSKG)
Gmock problem
 
Hi, i entounter some problem with the unit testing and gmock. My objectif is to test some interaction with the filesystem for example if a directory doe...
[no replies]
Passing methods to other methods
 
Hi, i have this data collection i which the nodes are linked by parent. meening multiple nodes can be connected to one parent. like in this http://i50.tinypic.c...
[9 replies] Last: Rather than the messy solution of passing function pointers around, ju... (by ajh32)
Serialization + shared data + QT executable
 
Hi I'm thinking to implement a game, but I have some design and technical questions. Explanation of the game: There will be a map, divided into little squ...
[no replies]
String to const char error
 
Hello, I'm currently finishing up an assignment that was half written by my professor. Below in the testGrades section of code there are two errors both are the...
[5 replies] Last: for addGrade() : You need to assign newGrade . This way it does not ... (by coder777)
realloc() Function
 
In the below program, int main() { int *ar=new int(); int *ptr=(int *)realloc(ar,12); cout<<sizeof(ptr)<<" "<<sizeof(*ar); } I have real...
[2 replies] Last: new is not the same as malloc. (by kbw)
by anibal
Double numbers representation in c++
 
Not very long ago I did this question for float numbers and the answer received was great. The function I use in my program is this: void FloatBits(float va...
[5 replies] Last: Thank you smac and Zaita, and thak you coder777. So, accordingly, ple... (by anibal)
Using Vectors for Manual Multiplication
 
Ok, so I'm trying to solve Project Euler 16 where you have to calculate 2^1000. SO I made a program that would solve multiplying a number b a single digit facto...
[5 replies] Last: You're welcome. Reverse iterators make things a little easier. I th... (by closed account D80DSL3A)
by erdc
expected primary-expression problem
 
I have read many post on why you would get this error, and it usually is because of syntax errors. Especially when getting the {} mixed up with (). I have thor...
[4 replies] Last: Opps, I compiled the wrong code to test the 'short' to 'shorted' out w... (by erdc)
Quick Vertex Array Question
 
Can I possibly use a Vertex Array with a multi-dimensional Array or will I have to convert it to a single-dimensional array? Converting it would not be that ha...
[no replies]
Why strcpy() works?
 
Hello, I am allocating space only for two characters but it fits all of them, if you run this it will print the whole string literal "hello my friend". How i...
[4 replies] Last: Hi Vlad, I did run your snippet however str did not overwrite s2, I g... (by vincegata)
facing problem in getting input in classes
 
#include<iostream> using namespace std; class person { protected: int id; char name ; char add ; public: void get_info(); void show_info(); per...
[5 replies] Last: Don't forget to put cin.ignore() after line 30 and after line 66 if ... (by Kart)
Simple sounds in C++
 
Hi everyone, I want to make some kind of simple sound playing program. I tried with the Windows Beep() function which lets you specify which note you want to...
[2 replies] Last: Thanks for the tips NwN! I'm sorry I responded so late, I was trying t... (by Niels Meijer)
Linker
 
Does anyone know if the Digital Mars compiler comes with a linker if so what is the syntax of it
[1 reply] : link.exe http://www.digitalmars.com/ctg/optlink.html (by JLBorges)
problem with C++ Piggybank, need some help.
 
I would really appreciate it if someone could help me with a problem i am facing, because seriously its driving me crazy, its the first time i am having such a ...
[no replies]
Problems in using C++11
 
I had been using Cygwin + NetBeans till now and today I found out that I was using an outdated version of GCC (3.4.4) so I updated to GCC 4.7.2 by installing Mi...
[2 replies] Last: Thanks a lot ! :) (by ChosenTorture)
C++ Programming Tutorials
 
A massive c++ programming datbase of tutorials: http://www.programmer-tutorials.com/
[1 reply] : C++ Tutorial - Dynamic Arrays How to create dynamic arrays Using mall... (by Cubbi)
January 2013 Pages: 1... 2021222324... 36
  Archived months: [dec2012] [feb2013]

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