49,767 Topics
![]() | |
hello, been googling this for a while and can't come up with anything good, so hopefully this won't be so easy to answer that it makes me look lazy. I'm writing an application for linux (gcc compiler) that calls various system and custom commands from inside my own program, nothing … | |
Here is my question Write a command line program titled joinTextFiles.cpp that concatenates the contents of several files into one file. For example, the following command line [B]joinTextFiles chapter1.txt chapter2.txt chapter3.txt book.txt[/B] will create a long file titled book.txt that contains the contents of the files chapter1.txt, chapter2.txt, and chapter3.txt. … | |
Okay so I'm trying to learn the basics of C++ from a book which is I think, well I know, a few years old. I already came across a couple of problems; Firstly the <iosteam.h> thing, which can technically be rectified by using -wno- deprecated in my djgpp compiler, but … | |
Hello :) I'm making a (new :P) game in C++, and in the beginning of the file, I'm initializing an array like this [code] int tower_dmg[5][3]; int tower_spd[5][3]; int tower_eff[5][3]; int tower_efc[5][3]; int tower_cst[5][3]; [/code] And later in the program, when loading images and initializing a lot of stuff, i … | |
Hi. I've searched the daniweb question database, and was not satisfied with solutions I found there. I have a string that looks like this... "100 1.745329252 0.984807753 -0.173648178 -5.67128182" not exactly words, but I want to select say, the third "word" of this string (0.984807753) into a variable. The whitespaces … | |
I know about using ran() to create a random number between x and y, however i am creating a banking program and i am wondering how to randomly generate a 17 digit pin, then store the pin in an outside file, then have the program check the file for the … | |
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. … |
The End.