General C++ Programming - March 2011 (Page 18)

by Gldnbr
Using structs in templates?
 
I'm really confused since I am totally new with templates. I have it display a list of numbers already, but now I need to display a list of structs (in my code...
[1 reply] : You will have to create a friend global overload function for the ios... (by guestgulkan)
Deleting the object pointed by shared_ptr
 
Hello everyone, Am new to shared_ptr & vector concepts & learned the basics by google it. But freeing the memory allocated which shared_ptr points to; is ...
[6 replies] Last: Thanks simeon for the detailed explantion. Gives some idea on shared &... (by maalathi)
Need help on multiply matrix operator.
 
I am trying to overload Multiplication Matrix operator with the following but I can't: This is the .cpp CFMatrix::CFMatrix(int m,int n) { _rowCount =...
[3 replies] Last: You are using += in the line of code, and setItem returns a void. So, ... (by Zhuge)
how to read data in text file?
 
Hi there, I need help in reading a list of data in a text file. What function do we use in order to read the list of data?
[8 replies] Last: I will try that code sometimes later once I solve my problem :) Anyway... (by student 123)
Simple error that I can't figure out.
 
I am getting an error but I do not know why. But it should be a simple fix but I am just not seeing it. Function: template<typename generic> void BST<gene...
[no replies]
by MayMey
boost split_regex delimit by "["
 
Hi, I am using Visual Studio 2008, and trying to delimit a string using the split_regex function from the Boost Libraries. I am trying to delimit by [ her...
[3 replies] Last: That's because '\' is a special character in C++, so you actually have... (by hanst99)
by Gldnbr
Templates and small error
 
I have this code where I add 5 numbers to an array. I have a problem with removing. I'm supposed to remove the first value in the array, but it's not doing...
[5 replies] Last: Okay, I see that now. Does anyone know how to delete the first value i... (by Gldnbr)
Memory Leaks
 
Hello! Got some problems with memory leaks,have no clue what im doing wrong tho. heres the code for the main file: http://pastebin.com/hLDmpJy3 I
[13 replies] Last: ,is cause i thought you didnt need a virtual destructor unless you al... (by firedraco)
by mpike
Highscores problem
 
Ok so a friend of mine came up with this code to create a highscores list for a game when i run it, it works perfect you can see everything fine. the problem co...
[4 replies] Last: no its fine ill be sure to try this method thanks a ton for your help! (by mpike)
identify my error?
 
Somehow I could not identify my error in my code. Can someone please help me? Below is the error that cause my problem. In member function `void student::setRe...
[10 replies] Last: Array[ 0 ] = 10; // Here, we are accessing the first element. May I k... (by student 123)
Help with Classes/Friend Functions and fractions
 
Hi there, I have an assignment that requires alot of use with classes, the idea of the code is to manipulate fractions to find greatest common denominator (G...
[16 replies] Last: Writing the code is more than trivial. Really. You have all that you n... (by hanst99)
Problem with random generator
 
I'm making a dice roll system where: The program is to display how many times each possible outcome of rolling the dice actually occurred. The problem is now, ...
[4 replies] Last: Yes I changed it to A ++; I also found the problem wich was in my mai... (by Envyness)
Finding Data Members
 
Hello, so I am trying to find out how I can access a websites data member. I am writing a software system that will recieve this data member as a parameter, an...
[no replies]
addition of int to object member
 
Hi - This is sort of a follow-on to an earlier thread, but I think it's different enough to merit a separate thread. I have a class: class reg { i...
[2 replies] Last: Again I really think you are misusing/abusing operator overloading. ... (by Disch)
Template Specialization Question
 
I have a function declared as such in a header file: template <class T> std::string to_string(T thing) { std::stringstream ret; ret<<thing; return re...
[17 replies] Last: Overload resolution of base templates. This is first time I encounter ... (by simeonz)
by sadon
Graph traversal
 
Hello, I have this simple map and im trying to find all the paths between any two nodes. A | B-C |\| D-E I created a matrix "paths " to contain ...
[1 reply] : There are well-known path-finding algorithms available. I suggest goo... (by jsmith)
Overhead of Inline Functions
 
I am writing a class to log string messages sent to it. To increase performance, I may at some point want to disable logging at compile time. I intend to make a...
[9 replies] Last: Well when I actually wrote the code in the Visual C++ IDE, I didn't in... (by anonymous23323124)
array
 
The findLargestDollarLoss function keeps getting the output of 0, did I mess up somewhere in the function? I tried setting largestLoss_so_far to equal dollarPro...
[5 replies] Last: Nope, never knew that. Thanks for telling me that by the way. Why didn... (by closed account zb0S216C)
Class member function address.
 
Hello, is there any way to get the real address of a member function after passing it as a function argument ? (I'm almost sure the problem come from me, as I ...
[7 replies] Last: @jsmith: I like std::set because of its ability to ensure only one ins... (by naaokth)
Using SDL Threads and Templated Parameters
 
Hello, I need to make an SDL Thread that performs a matrix multiplication. The matrix class I wrote is templated so I can store any type of data in it. From wh...
[7 replies] Last: Alright, it seems that I AM able to modify the void* by just adding th... (by Gil Galvanti)
March 2011 Pages: 1... 1617181920... 31
  Archived months: [feb2011] [apr2011]

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