49,761 Topics

Member Avatar for
Member Avatar for acediamond

I am a first year IT student cramming my last assignments in before the monday afternoon deadline. I am battling with a problem that looks like this: I have to create a program using the case statements to choose a winner from rock, paper, scissors and count the wins,losses,ties to …

Member Avatar for VernonDozier
0
265
Member Avatar for amit1701

hi everybody, these two codes returns pointer to an object declared and defined within the function. yet both of them prints the correct value of the variable c in main(the values of variable c should have been destroyed when the call is over.). the first code gives the warning. but …

Member Avatar for Jishnu
0
128
Member Avatar for x_calibur

Hi, I'm having a problem understanding this thing. Suppose I have a function that returns a generic value. Inside I have "try" and "catch" statements for exceptions. Now once those exceptions have been detected, what and I mean in the name of Jesus butt-hole is my function suppose to return? …

Member Avatar for Alex Edwards
0
114
Member Avatar for windscar

What's used to storage 2d data like this: ID --- ITEM ------ TYPE ------ PRICE ------ WEIGH 1 ---- hammer ---- 3 ---------- 1300 ------- 67.0 2 ---- sword ------ 2 ---------- 800 --------- 42.0 3 ---- katana ----- 2 ---------- 2200 -------- 21.0 So I can acess it to …

Member Avatar for VernonDozier
0
70
Member Avatar for mariaczi_pl

Please... help... in file is complete project . please..help..i need this so fast.. i need managed to make windows forms.. before this project i made a small project and all was ok.. and now.. help

Member Avatar for Ancient Dragon
0
141
Member Avatar for Ellisande

Back with another question concerning my RPG. I had the idea to do a multi-dimensional array to represent a map, with each element in the array being it's own square, Depending on where you are, you can move in any of the 4 directions, unless you are on an edge. …

Member Avatar for Ellisande
0
246
Member Avatar for ibe123

Below is my problem... I think section 1-3 are okay, but I am having problems with sections 4-7, Any help would be great. I also need to load these from a file... I just loaded the array by initializing the values as I thought I could start there check my …

Member Avatar for joshmo
0
120
Member Avatar for henpecked1

This one actually tells me visual studio has a problem and needs to close this code. I'm sure it's in the insert/write section, but I'm not sure what I did wrong. I'll post the rather simple cpp below it. [code] #include <iostream> using namespace std; template <class T> class list …

Member Avatar for henpecked1
0
133
Member Avatar for henpecked1

If you grab this code and run it, you'll see what I mean. The second half doesn't run, and when I can get it to run, it's all completely wrong. I'm trying, but I'm tired and just want to get it done...lol. The encrypt and decrypt are a separate cpp …

Member Avatar for henpecked1
0
110
Member Avatar for Bitto11

Hi. Does anyone know how to execute system() statement in a DOS Emulator like DOS BOX. For example for the following code : [ICODE]#include <stdlib.h> #include <stdio.h> int main(void) { printf("About to spawn command.com and run a DOS command\n"); system("dir"); return 0; }[/ICODE] It only displays "About to spawn command.com …

Member Avatar for Duoas
0
111
Member Avatar for Black Magic

Hey, my dad was checking the "lotto" results so that inspired me to make a little program of my own, i accomplished that just got a problem.. [CODE=C++]#include <iostream> using namespace std; int main() { srand(time(NULL)); unsigned int lotteryBall; for(int i = 0; i <=7; ++i) { lotteryBall = rand() …

Member Avatar for VernonDozier
0
174
Member Avatar for Kadence

Can getc()/putc()/fgetc()/fputc() be used to read/write chars and floats rather than ints only from binary files? If so, how?

Member Avatar for Kadence
0
226
Member Avatar for Sniperx

how do i determine the smallest nr of an input of three hours in a 2D array? the program is that you must have an input of 3 hours for 3 modules for each studend(4)

Member Avatar for Ancient Dragon
0
73
Member Avatar for Alex Edwards

I found an interesting question on the internet... An interviewer asked a programmer "How would you divide without using division or multiplication?" And the programmer came up with some weird bit shifting operation that did the division. Now, I'd like to make a program that does something similar, since-- int …

Member Avatar for Alex Edwards
1
382
Member Avatar for SteveDB

Hi all, With some help of others, my code now works. To those who helped-- again, thank you; immensely! Yesterday, I stumbled across the form builder in VS Express 2008. I've built my forms-- via the new-fangled drag/drop that I've come to love so much (as opposed to writing/typing them …

0
72
Member Avatar for Ellisande

I'm having this weird issue with a text based RPG I'm trying to create. I'm fairly new to C++, so I thought having a project that I can work on and expand as I learn more would be a good way to put what I have been reading about into …

Member Avatar for Ellisande
0
124
Member Avatar for SteveDB

Morning all. Hope everyone has great weekend. Once I get done posting this I'll be digging yet another hole for my spinkler system, and hopefully finishing off my drip system for more backyard. Ok.... Onto my issue. After a week of struggle to find out why I kept getting errors, …

Member Avatar for SteveDB
0
817
Member Avatar for henpecked1

If this is the original class: [code] class StorageBin { public: StorageBin(); ~StorageBin(); void PutInBin( int Item, int Location); int ReturnFromBin (int Location); bool FindInBin(int Item); void DisplayBin(); private: int *pBin; int NumberInBin; int BinSize; }; [/code] Would this be the correct conversion to make it a template? [code] Template …

Member Avatar for Alex Edwards
0
234
Member Avatar for wcmport

This is the code I've written for a homework assignment - however in the footer for Cases B & D I have no idea what I should have for coding to get the correct count - any help/comments is greatly appreciated! /* as long as actual birthday has occurred life …

Member Avatar for VernonDozier
0
113
Member Avatar for kaleshwar

ok before someone points me to google or to the search box, let me state that I have already done the searching. The solutions I get either state using winsock(which happens to be windows only):( or parsing the output of ifconfig(which happens to be linux and maybe unix only):( and …

Member Avatar for Ancient Dragon
0
104
Member Avatar for awi123

Hi i just wanted to ask whether we cud use #include<string> and declare a data type called 'string' eg. string ch;? and where is "using namespace std" used?

Member Avatar for Ancient Dragon
0
84
Member Avatar for henpecked1

When I'm opening a file, is it the file that is text or binary or is it the stream that can be text or binary? Also, when I close a file is that when the stream object is destroyed?

Member Avatar for Ancient Dragon
0
126
Member Avatar for Sniperx

hey there, im new on C++ and have to do an assignment where i have to display names of soccer players and the number of goals and cards received. im busy with my first function, and if someone can help me i would realy apreciate it. //question 1 assignment 4 …

Member Avatar for Ancient Dragon
-1
179
Member Avatar for Foo_with_a_floo

GREEDY COUPLE A party game has the fourteen party guests sitting in a circle on chairs numbered, in a clockwise direction, one to fourteen. A cup of beverage is passed from person to person around the circle in a clockwise direction, starting with the person sitting on chair number one. …

Member Avatar for joshmo
0
191
Member Avatar for Nashy

Hi people, who know how to use double buffering in graphics.h library? I have some problems with blinking, so I would like first write objects to bitmap and than to screen. Can anybody help me?

Member Avatar for Ancient Dragon
0
61
Member Avatar for Alex Edwards

[code=c++] #include <cstdlib> #include <iostream> /** Test Class for learning template-metaprogramming */ using namespace std; template<int N> //General case for a number class ShowValues { public: static inline void show() { cout << "Start: " << N << endl; ShowValues< (N > 1) ? (N - 1): 1>::show(); cout << …

Member Avatar for vijayan121
0
127
Member Avatar for dougy83

Hello, Does anyone know how to use _popen in windows xp sp3 (console application) to allow writing to a process? I've tried using _popen to read from a process. This works as expected. When I try _popen with write access, the process starts, but no commands are interpreted. My code …

Member Avatar for dougy83
0
265
Member Avatar for rje7

[code] #include<iostream> using namespace std; class welcome{ public: welcome(){ cout<<"Constructor"; } }; int main(){ welcome c; return 0; } [/code] for the above code i get the following errors wen i try to compile using GCC in PCLinux minime version. cannot figure out if there is an error in my …

Member Avatar for rje7
0
120
Member Avatar for CrackWizard

Okay. I play a game called chain of command. It's abandonware, the original designers went bankrupt and the source code got lost. The server and game files and such were all on a backup server and acquired from one of the original designers. I was just told we need to …

Member Avatar for Necrolis
0
237
Member Avatar for thehype2049

Ok, so im doing an assignment and Here is the question: -------------------------------------------------------------------------------------------------- Using the base class Person which has two member variables called name and birthday [both of type string], derive two separate classes from Person, called Student and Professor. The Student class has a major [string] and a gpa …

Member Avatar for thehype2049
0
88

The End.