49,766 Topics
![]() | |
[CODE=c++]#include <iostream> #include <fstream> #include <string> using namespace std; int main() { string linea; ifstream fileIn("input.txt"); ofstream fileOut("output.html",ios::out); //working with the input text if (!fileIn) cout<<"\nERROR: Unable to read the file!\n"; else { //working with the output text if (fileOut.is_open()) { fileOut << "<html xmlns=\"http://www.w3.org/1999/xhtml"; fileOut << "\" xml:lang=\"en\">" << … | |
Hi, its an assignment i need to do. The while loop working on well when i input an integer but when a letter is being input, the while loop run for infinity. I had seen through the other thread but still cannot understand how to do. Please help... [CODE]while(choice!=1&&choice!=2&&choice!=3&&choice!=4) {cout<<"The … | |
I can not seem to figure out how to drop the lowest score. When I run it it says the lowest score dropped was 0. How do I fix this? [CODE]#include<iostream> #include <string> #include <cmath> using namespace std ; string getName (); int averageScores( int); void printMessage (string, int); void … | |
So this is my first post. I looked everywhere and can't find any help. Here is the problem: Create a 2 dimensional array of integers with 3 rows and 8 columns. Fill this array with 0’s and 1’s (binary numbers) randomly. Each row represents a byte. You are to add … | |
first off i apologize for my ignorance but i cant seem to find a clear answer to this question, if i have a function with variables in it, do those variables reset every time i call the function for example if i write code to build a game and then … | |
Basically If the user does not enter a string or character or press any keys after a certain length of time, program will goto or ask again.. or do whatever.. Problem: Not allowing the user to enter input.. Note accepting user input.. [CODE] #include <windows.h> #include <stdio.h> #include <iostream> using … | |
Hi there, I want to get the process name from the process id (pid) in C/C++ program. Please help me. I am using linux machine. | |
Please help me solve this problem, just started c++ and I am lost, this my 1st computer class, please help Write an interactive program that prompts the user for two integers (X and Y) and a value Option) indicating an option. Depending on the value of the option, the program … | |
Hi everyone, I made a program that will check if a process is running.. it is supposed to detect if a process is running and start a timer. If the process has been ended, the timer is paused.. when the process is restarted, the timer continues from where it last … | |
I need to input 3 full names separated by commas Full Name 1: John, Smith, Flynn Full Name 2: Walter, Kennedy, Roberts Full Name 3: Sam, Bass, Clinton Then output it like this First Name 1: John First Name 2: Walter First Name 3: Sam Middle Name 1: Smith Middle … | |
Trying to get an outcome that looks like this.. # ?# ??# ?# # What I'm getting is this... # ?# ?#?# compiles ok, but as you can see it places the # after each ? rather than grouping them together, and it neglects to count back down. Don't want … | |
Hey all I have a dynamic array of pointers to instances of a class ("Player"). The constructor for the Player class looks like this: Player::Player(void) { this->leftChild = 0; this->rightChild = 0; srand (time(NULL)); this->id = rand() % 1000; } The dynamic array of pointers looks like this: Tree* PlayerTree … | |
Can someone explain how to get this output? How do I trace this? Output: * ** *** **** ***** ****** ******* [CODE]#include <iostream> using namespace std; void Triangle(int x) { if (x <= 0) return; Triangle(x - 1); for (int i = 1; i <= x; i++) cout << "*"; … | |
Hello again! Another noobish question :) Can PHP be ran in MFC? Can i add it right in teh html file or convert it over to php? or do i include it in html? do i create a box in c++ tat connects to the php page? or do i … | |
I need help figuring out how to write a program with recursive functions in order to identify the path to a given maze. The maze is read in from a file and then when the path is found the maze is printed with the path shown. The read in maze … | |
I got my hands on the Accelerated C++ book and I'm trying to work the exercises. I want to see the solutions to see if I'm right and see how they did it and how i did it. | |
/* this program compiles is almost done, but i cannot get the las function to sort numbers from the array. the output should have the even number on the left and odd numbers on the fright.*/ [code=cplusplus] #include <stdio.h> #include <stdlib.h> #define N 9 void revArray(int *a); /* reverse an … | |
Hello! I'm a beginner in the worl of C++. I'm building a program that acts as a launcher for a game. In it I have Start and Exit button. What I want the Start button to do is start an .exe with extra conditions: IP and Port. [CODE] if (nResponse … | |
I'm using the function CInternetSession::OpenURL in a "try" to open a webpage (a servelet which returns XML). The servelet take a little while to respond sometimes (around 13-15 seconds in a web browser). When it's slow like this, the code catches a CInternetException. Is there a way to see what … | |
So I've only been programming for a few weeks, and I thought that I'd learn how to program by converting a rather complicated baseball board game to a program. I'm writing a preliminary program that stores player information from a card into a random access file. My Struct holds the … | |
![]() | Hi, I am writing a program that allows to keep track of some racing records and to do this I need to be able to save objects on a external file and then load them with next startup of the program. As I am just a beginner I need your … ![]() |
So, once again, this is a really dumb question. I am outsourcing some C++ Programming work for a game. When I say outsourcing, I mean India, so I will never meet these programmers. I was just wondering how I would get the coding off of them. Can I simply ctrl+c, … | |
hi everyone. i am working on the tower of Hanoi code and got a very interesting question. Here is the code of Tower of Hanoi problem: [code]#include<iostream> using namespace std; void move( int n, char*s, char*i, char*d ) // s stands for source tower // d stands for destination tower … | |
It's my first code. I put alot of effort into it. I just haven't been able to see if it actually works because tomorrow I go the the computer lab to test it. Positive and negative feedback is welcomed. Also, here is a link to the description of what the … | |
| |
Hi guys i am trying to write a program that counts the number of lowercase characters in an input file and display the two most used lowercase letters. My problem is I dont know how to get my program to count each lowercase character and save them into an array … | |
Something very strange is happening. I put a breakpoint in VC++ at the line [icode]char *arg[/icode] and string is what it should be. But as soon as I go to the next line, string changes to this: [icode]0x0012f864 ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ[/icode] I really have no idea why this is happening and I … | |
How do I create a pointer for a struct. This is an example [CODE]typedef struct worker_t { char name[25]; job_t title; double payrate; double hours; }; int input(worker_t); [/CODE] I tried it here [CODE]worker_t employee[10]; worker_t* ptr_worker; *ptr_worker = &employee; input(worker_t employee[10]); [/CODE] I know how to use pointers on … | |
need help adding feeting and inches together [CODE]#include <iostream> using namespace std; // introduces namespace std int main () { int ft1, in1; int ft2, in2; int ft3, in3; int total; int fft; int iin; cout << "The measurement in feet and inches" << endl; cin >> ft1 >> in1 … | |
I can't figure out why I am getting this error. I have tried #include several things and I have tried changing the location of srand. #include <iostream.h> #include <ctime> class Horse { int position; public: Horse(); //Horse constructor??? Per UML int random; srand( time(0)); void advance(){ random = rand() % … |
The End.