General C++ Programming - August 2012 (Page 9)

Free'ing Unowned Space
 
So, I was tinkering with some code I decided to write and came across a dumb idea. What if we "new" an object without assigning it. Does it automatically get f...
[9 replies] Last: Instead of returning a raw pointer you could return a unique_ptr. std:... (by Peter87)
by EirikO
Represent datatype with given resolution
 
I would like to represent a given datatype in my C++ code. (A measurement signal with given resolution) The input real measurement signal can represent value...
[3 replies] Last: You could use a library that provides fixed point decimal numbers supp... (by bartoli)
Searching for a string
 
Hi I am writing a code for showing a student's mark list. I have a file containing every student's name and his marks in each subject. I have to make a dro...
[3 replies] Last: Never Mind.. Got it.. char szLine =""; fgets(szLine, sizeo... (by gaurjimmy)
Program crashes using getline
 
Im stuck on a function for a program im creating to help keep track of my workouts. Im using the STL list, but for some reason the program crashes once it reach...
[5 replies] Last: It's strncpy that fails, you reversed the parameters. char * Conver... (by naraku9333)
Copy Constructor question
 
I have a class that contains pointers to instances of the same class as attributes. How would a copy constructor look for this. I understand that I may not be...
[4 replies] Last: Great...thanks a bunch. Node::Node(const Node &aNode) (by troutguy)
by ToniAz
Freeing Space in Array-Returning Fonction
 
Hello everyone! I have a serious issue: I only recently noticed this: int * foo(int * in, int s) { int i; int * out = (int *) malloc(s * sizeof(in...
[4 replies] Last: Most implementations of malloc() write some information about the retu... (by helios)
problem with some codes
 
CListCtrl *pList = (CListCtrl*)pDlg->GetDlgItem(IDC_LSTFILES); CTreeCtrl *pcTree = (CTreeCtrl *)pDlg->GetDlgItem(IDC_TREDISKS); hTreeItem = pcTree->GetS...
[1 reply] : i dont understand it either, but if you do not understand the code, do... (by warrier)
by nuju
Write a custom audio mixer
 
I'm going to be using PortAudio as a cross-platform audio player, and i'd like to write a custom mixer for use with it. The problem is, i have no idea how to do...
[6 replies] Last: Thanks for all your help everyone. I'll look over this! (by nuju)
by cniper
employee database using vectors problem (1,2)
 
i am supposed to write a program for employee database with following details: 1. All employee have first name,last name and salary. 2.Engineers in addition t...
[26 replies] Last: well, you were on the right track and willing to solve the problem. so... (by coder777)
overload vector find
 
I have this programm, but says me : test.cpp:22:43: error: no matching function for call to ‘find(std::vector<std::vector<double> >::iterator, std::vect...
[1 reply] : You shall include header <algorithm> (by vlad from moscow)
const keyword usage
 
Hi, I would like to know different types of using const. I am confused of using const... for eg: class A() { void B() const; void const B(); } ...
[1 reply] : Consider non-static member functions as having implicit additional fir... (by vlad from moscow)
set of struct
 
Hello I am trying to make a set of struct in c++ but I am having errors, and I could not make it. I made 2 options. First one: struct pointsSet { d...
[2 replies] Last: Hey, thank you for the repply! I try to make that, and have this erro... (by gonza8888)
by ajbm6
help!
 
I'm new to c++ and I have a problem with my project. This are the clues. Convert an integer to string using the following code: int number = 5; //any intege...
[1 reply] : http://cplusplus.com/forum/beginner/1/ (by cnoeval)
avoid new line after cin.
 
I would like to print some thing out. Then the user should be sble to input a number. Now i want to avoid the programm to jump to a new line. Possible? and ...
[4 replies] Last: Here's an idea, don't bother. Concentrate in your program instead of t... (by ne555)
by dorien
help with unhandled exception
 
Hi, I'm working with a code that I found online. After I resolved all the errors I tried to run the program, but it keeps giving me an unhandled exception. ...
[16 replies] Last: I found the problem: I accidentally changed 1 line into comment. This ... (by dorien)
polymorphism problems from java to c++
 
Hi, I am looking at the Artemis framework for component-based entity frameworks which is in Java. A quick bit of background: Component-based entity frame...
[4 replies] Last: OMG? (by Ultimatenero)
by ToniAz
void * as function argument
 
I am trying to be a smart#$% to have a C function dealt with a generic array (kind of like I'm reinventing template in C++). Does this work?
[2 replies] Last: It's safe if you cast back to its original type, the problem is that t... (by aquaz)
OOP game
 
Well, Im making a c++ OOP game and I have a character class, and a separate class for every signle character. How can I make a character selection menu?
[6 replies] Last: A game is a great thing for OOP. A charakter is certainly a class. A l... (by coder777)
Reading Through a File of Ints and Strings
 
I have a text file that contains both integers and strings. There's a pattern to it, which goes: Int Int String Int Int String ... What I want to ...
[11 replies] Last: Okay, thanks for the explanations. Aha, I will. It's just nice to ge... (by MottMan)
c/c++ refernces
 
Hello anyone know any good sources for finding reference documentation for c and c++ language and earlier manuals. Best regards Christoffer
[2 replies] Last: man (for C) (by ne555)
August 2012 Pages: 1... 7891011... 31
  Archived months: [jul2012] [sep2012]

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