General C++ Programming - March 2014 (Page 21)

Strange problem while reversing string
 
#include<iostream> #include<cstring> using namespace std; void push(char *str2,int *max,int *top,char *item) { if(*top==*max-1) cout<<endl<<"Stack is ...
[2 replies] Last: Thank you very much MiiNiPaa, you saved my hours!!!!! (by Shantam)
by Nebur
Doubt about static functions declaration in classes
 
Hey, I want to declare a static function that returns a boolean and my question is: where should I explicitly declare it as an static function? In the .hpp, in ...
[2 replies] Last: Thanks a lot! (by Nebur)
strange variable init
 
hi i've found this type of initialization in a source of another person but i cant understand the way of an init of the type: var1 = 2; tot = var1,var2; ...
[1 reply] : it does tot = var1 , var2 is unused. However if line looks like in... (by MiiNiPaa)
Segmentation fault
 
Hi, I have a project where I am required to make a working 2-player game of battleship. My code is written up until players actually start making moves but I'm ...
[3 replies] Last: A simple run through debugger shows, that segmentation fault is on lin... (by MiiNiPaa)
print asterisks to correspond to my program
 
Hey guys so i have to make two functions one recursion that ask the user to enter number of rows and i use recursion to tell him how many pins there are ex. use...
[1 reply] : There is few cases where recursion is ppropriate and this is not one o... (by MiiNiPaa)
How to use the timer in c++
 
Hey guys so i have to time how long each of my functions take to run and am stuck i know i have to use the time.h but i don't know how to start and end it heres...
[1 reply] : #include <iostream> #include <ctime> int main() { // http://www.... (by JLBorges)
by Cassie
display scores on notepad from c++
 
Hi. I'm new here and I have a problem on my program. I want to display the scores on notepad. I can display it but the problem is every time I play the game th...
[4 replies] Last: Thank you very much :)) (by Cassie)
game questions
 
I am creating a game and I using classes for other things in my game, I was wondering if i should use classes for rendering objects? popa6200
[2 replies] Last: Need more information. (by SaiF PUNK)
I keep getting the fatal entry point must be defined error please help
 
I have done several programs already I don't know why this one is giving me that stupid error. Some please help I have to turn this in 2 hours. #include <ios...
[2 replies] Last: remind me to kill myself (by wafflez)
Help with homework please
 
@wafflez Your declarations need to changed. int a = Mercury; int b = Venus; int c = Earth; int d = Mars; int e = Jupiter; int f = Saturn; int g = Uranus; int ...
[1 reply] : wowowowow thank you so much I totally forgot about implementing the st... (by wafflez)
by kdeng
Confused as to how to pass array into if statement?
 
#include <iostream> #include <iomanip> using namespace std; double calculateCharges(double hours , double sizeofArray);//call function int main() ...
[3 replies] Last: Ah I see thanks for the information my professor didn't explain that p... (by kdeng)
Terrain Deformation
 
I am creating a terrain deformation program that reacts to gameobjects colliding with the terrain and leaving an impression. For this to work properly I would l...
[3 replies] Last: Niiice! Thanks a lot! :) (by Anonagon)
Airplane Seating Program
 
#include <iostream> #include <iomanip> #include <fstream> #include <string> using namespace std; struct airplaneseats { string column0; string ...
[3 replies] Last: Hey Daleth thanks man I really appreciate it. I've been working on thi... (by rosales5)
by therio
How to open a java layout from C++ archive
 
I want to open a .xml layout in my Android project from a .cpp archive. How can I do it please?
[2 replies] Last: XML is an old and well-known format, just find a small lightweight C++... (by LB)
Picking multiple objects from background
 
Hello, Quick version: Does anyone know of any image processing libraries/techniques that can pick out shapes from a background accurately, even given signific...
[no replies]
How to make this class? I'm struggling..
 
...
[1 reply] : Any ideas on how I would do this? 1. Define a class called MonthDa... (by kbw)
[win32api] can't enter text since editcontrol is too small
 
when I enter enough characters to fill the edit control, it wont allow me to enter more, like this: http://filebeam.com/0834d45f0cb05fd7e4527674ab61f633.jpg ...
[14 replies] Last: okay, and what's the notification message for when I enter text that f... (by mekkatorqu)
Decorator Pattern Method. How to avoid these repetitions?
 
How to avoid the repeated lines indicated below? #include <iostream> class Player { private: std::string name; int hitPoints; public: Player...
[3 replies] Last: Okay, here is my solution using template specialization for MagicUser,... (by prestokeys)
Class protection classifications
 
Is there a way to make the Height property of CELL in the code below act in a way that allows the programmer to access Height without changing it? I've tried...
[3 replies] Last: How about adding getter for that value? Or you can google property cl... (by MiiNiPaa)
by KREB
I'm taking a CSCI Programming class and I need help with an Assignment!
 
For this assignment I have to: Write a C++ program that prompts a user to input the birth year (i.e. 1998). Based on the current year, determine if the perso...
[2 replies] Last: Here's part of your answer... bool CanIVote(myBirthYear) { int d... (by HellfireXP)
March 2014 Pages: 1... 1920212223... 36
  Archived months: [feb2014] [apr2014]

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