General C++ Programming - February 2013 (Page 24)

//this series of if/else statements allows the //program to ignore leading zeros.
 
Just wondering some different ways to do this code without else if statements? //this series of if/else statements allows the //program to ignore ...
[1 reply] : Here's a way, ugly, but works. #include <iostream> using namespace s... (by Spikerocks101)
Pretty lost on defining operator[]
 
I'm a college student, and a bit lost on part of a homework assignment. The premise is we have a .h file containing all the function declarations and are com...
[1 reply] : // ... T& operator (int i) { return i<m_size ? m_... (by cire)
cin.get()
 
how can i display the number of variables or character that the user input?
[4 replies] Last: Give an example of what you would like counted for a more specific ans... (by Elidor)
by LB
std::bind to c-style function pointer
 
Let's say I have to pass a function pointer to a library, and the library will call that function with no parameters. I got the impression hat std::bind allows ...
[13 replies] Last: @ computerquip: I said "C style" callbacks - where C++ functors are n... (by Disch)
by Sucho
Passing Dynamically Allocated array in function
 
In a program I'm working on now, i need a milti-dimensional array. To save space, I used dynamically allocated array by using pointers, something like this- i...
[4 replies] Last: I tried using the first process you told, i.e using (int* a,int row,in... (by Sucho)
by PPAC13
Help please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
void option() { bool verify2 = false; while(verify2 == false) { string response; bool verify = false; cout << "Which ...
[5 replies] Last: Thou I don't know exactly if this will fix it, but worth a try, I gues... (by Spikerocks101)
Problem with while statement
 
I am trying to get my program to ask for a character input, and based on that input, ask the user to put in different numerical values for certain questions. I ...
[2 replies] Last: You can see what minor changes I've made and the print out. #include... (by buffbill)
cin has muliple inputs
 
For a program I am required to use a cin that accepts 4 variables. The first describes a function such as add(), remove(), print(), or quit(). The problem is th...
[1 reply] : If you don't need to read them, then don't read them. (by ne555)
help! linked list with 2 classes
 
solved thanks.
[2 replies] Last: anyone? (by tinywee)
access data outside a function
 
I was wondering what the best way was to access data outside the function it was created in. I have the user input a data in a custom namespace function, and no...
[9 replies] Last: Just declare and initialize each outside of the function where they ar... (by buffbill)
Need a Perfect Square Factorer
 
I'm having trouble with a function of mine. It is supposed to factor out all the perfect squares within a number. For example, say the number was 24160, I need ...
[no replies]
Turn based game turn order
 
How would one cycle through a turn order in a turn-based game? I was thinking an array of every creature (including the player) and have a pointer to the array+...
[2 replies] Last: I couldn't figure out how to put them all in an array. There's a playe... (by sikuneh)
check pointer to class object for null value
 
This is jamming me up a little bit. I've been thru the tutorial on this site but the bit about null pointers I apparently don't get.. Thanks in advance for any ...
[4 replies] Last: Ah so Thanks guy, is all good now. Much appreciated. Not sure why I di... (by cPlusN00b)
the problem with the pascal triangle
 
#include <iostream> using namespace std; #define x 10 int main() { int i,j; int a ; for(i=0;i<x;i++) { a =1; } for(i=1;i<x;i...
[3 replies] Last: thanks, I got it. (by DANNY123)
Where is DirectX SDK installed by default?
 
So a long time ago I messed around with DirectX but I don't remember where it gets placed by default. I want to just get rid of the SDK and get the up to date v...
[4 replies] Last: The Windows SDK for Windows 8 is the version of the SDK which supports... (by andywestken)
Program to display AM/PM with Current Time
 
I'm trying to display the AM/PM on my program: Also is there a way to display the time only instead of the date? How will i change the program to display the...
[1 reply] : http://cplusplus.com/reference/ctime/strftime/ look at the example (by tntxtnt)
by kiste5
Project help
 
need help starting and understanding this project Write a program that reads in ten whole numbers and that outputs the sum of all the numbers greater than z...
[5 replies] Last: delete line 8, 19 and change data in line 21, 23, 25, 27 to relayer a... (by tntxtnt)
by ckw77
Lotto Simulation Problem
 
I think I got pretty much of the code, but I need help on the bottom. How do i define user and lottery.. Confused!! Also code is confusing so help also... //De...
[15 replies] Last: Uhhhh ok, Previous code to fix = ADDED FUNKY COLORS! #include "conc... (by greenleaf800073)
need help with opencv
 
Hi I am doing a project, which requires me to create a program which would calibrate the camera. I need help as i have written the code but there seems to...
[14 replies] Last: I have contacted the forums and still no response. So i am not using ... (by asda333)
by cob
Loop in a Text-Based RPG
 
So, I am working on my first RPG. Nothing fancy so far... I haven't developed a story or anything, just trying to get the gameplay hammered out. Anyway, I have...
[1 reply] : I just skimmed your problem and don't really have a direct answer to y... (by Disch)
February 2013 Pages: 1... 2223242526... 43
  Archived months: [jan2013] [mar2013]

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