49,761 Topics
| |
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 … | |
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 … | |
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? … | |
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 … | |
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 | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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() … | |
Can getc()/putc()/fgetc()/fputc() be used to read/write chars and floats rather than ints only from binary files? If so, how? | |
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) | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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? | |
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? | |
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 … | |
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. … | |
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? | |
[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 << … | |
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 … | |
[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 … | |
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 … | |
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 … |
The End.