General C++ Programming - February 2012 (Page 23)

by oonej
Returning undeclared ..
 
I have an overloaded operator that returns a Matrix, when the Matrix can't do the computation, i need it to output text instead... is this possible? I hav...
[10 replies] Last: That only works if you're the immediate caller of the failed calculat... (by clanmjc)
Frequency Distribution Formula
 
I'm in the process of writing a program for school which takes in a set of values stored in a vector and outputs some basic statistical information on the set. ...
[2 replies] Last: There are a few steps to this: 1. Populate your vector of values; 2. ... (by Stewbond)
Program is not recognizing my overloaded >> and << operators
 
I have a program that utilizes a simple class matrix<T>. I have overloaded the operators for >> and << as below. These are friend functions declared in the matr...
[14 replies] Last: Why do you have a cout message in your operator>> ? When you do: fl... (by closed account o1vk4iN6)
Two files, to be opened/read differently
 
I have two files, listed on two lines in "input.txt". They both contain similar data, but I don't want to treat them the same way. I open the first one with: ...
[1 reply] : getline(inFile, fileName1); getline(inFile, fileName2); nomFile1.ope... (by Moschops)
Help with Timer
 
ignore the fragmented statements and (currently) useless code, i just want to get this feature working before i continue. Once you run it you will see what i me...
[4 replies] Last: thanks, this kind of works, but here is the problem. I want the user t... (by ramus313)
by Zapeth
Check if something wrote into char array?
 
Hi I am currently trying to figure out how to check if something wrote into a char array after it got initialized. Here's a more detailed description of my pro...
[2 replies] Last: Of course, I guess I was blind back then :D Thanks for the help. (by Zapeth)
Whats it doing?
 
Hi I've very little c++ experience and was wondering could someone explain to me what this bit of code is doing? It's mainly just what the x array is doign whic...
[8 replies] Last: float a = (n % 2)? -x : x ; it says that if n is an integer that ... (by therockon7throw)
Problems in passing a multidimensional array to a function
 
Dear Sirs, I have some problems in passing a 2D array to a function. I know that I have to define the dimensione of the second index of the array, but in my c...
[5 replies] Last: @chianda, can't say anything without seeing your code. Segfaults are u... (by hamsterman)
by latnoa
Iterations? Sequences
 
Hello I'm trying to program a sequence and I think I might have successfully created one ( if not feel free to point out the problem) while (n>=1) { if (...
[3 replies] Last: simplified code: while(n > 1){ if(n % 2) n= (3*n) + 1; else ... (by Vins3Xtreme)
Can pass bool operater to function?
 
There are few questions about functions. 1-Can we pass bool operator to a function in C++? 2-Can return type be bool operator? 3-Can pass string to functio...
[1 reply] : Yes. (by alastairl)
Pointers + Joesphus Problem
 
Hi everyone I'm doing a c++ program that simulates the Josephus Problem: http://en.wikipedia.org/wiki/Josephus_problem I have to use and linked list, but I...
[4 replies] Last: Personally I detest this kind of thing: typedef ListRec * List; It ... (by Gaminic)
by jnrakk
An array of functions?
 
I know this has been asked before, but this is a slightly different question. I know i can do this: int itemList { { item.damage(), 5, 8, 12, 9...
[2 replies] Last: please explain it in words what you want really to do ? (by therockon7throw)
what the problem had errored??
 
If I refect the line of number 18, 44, the code'll run good. I try to think but I haven't found the false!! You concertrate to line (18, 44). Please check it f...
[8 replies] Last: ok! thank for all comments.. (by nguyennhutbinh)
SDL Application crash
 
Hi, Edit: Sorry for the long code, I wasn't sure what was(n't) relevant. Working on a basic game using SDL. Whenever I run the following code, my project cras...
[3 replies] Last: In the enemyCar destructor you do enemies.erase(enemies.begin()+carCou... (by Peter87)
how to overload unary operator '!' as member funtion
 
Hi folks, I am learning operator overloading concept in c++, wrote sample program to test overloading of unary operator '!' and '-'. Code will work if i use t...
[2 replies] Last: Try removing the arguments for your operator functions. I believe th... (by Stewbond)
Difference in printing char* & int*???
 
Hi all, First post! Hoping you can help as I'm really confused! In the following code: int main () { int* NumberArray = new int ; int a = 0; f...
[7 replies] Last: OK makes sense, thanks very much for your help :D (by closed account o360pfjN)
3rd Person Camera Lerp Problem!
 
Hello, I am currently making a third person camera in the UDK that switches between three different offsets based upon what the player is doing. I have one offs...
[1 reply] : Sounds like an interesting problem. Why did your strategy of snappi... (by mik2718)
Tree problems
 
I've got to go to work soon so I thought I'd see if anyone can figure out what I've done wrong, if there are leaks I can fix those later but I need this tree to...
[1 reply] : Didn't close the file (by awsdert)
Convert Sint16 to int ?
 
I'd like to convert sint16 (short int 16-bits) to int. Or otherwise, I'd like to compare sint16 with int Cuz no functions support these operands
[1 reply] : You can just cast it: short a = 10; int b = (int)a; If it is for ... (by Stewbond)
Difference between Createthread,beginthread,beginthreadex
 
I am new to this forum and for c++ also. Can any one tell me the exact difference Createthread,beginthread,beginthreadex........ I have searched many links bu...
[2 replies] Last: Thanks very much for ur quick reply................. (by sharath137)
February 2012 Pages: 1... 2122232425... 43
  Archived months: [jan2012] [mar2012]

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