49,766 Topics

Member Avatar for
Member Avatar for CronosAkroma

[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\">" << …

Member Avatar for WolfPack
0
138
Member Avatar for Alice1990

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 …

Member Avatar for jonsca
0
318
Member Avatar for plang007

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 …

Member Avatar for plang007
0
631
Member Avatar for kas04

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 …

Member Avatar for kas04
1
137
Member Avatar for beejay321

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 …

Member Avatar for sfuo
0
139
Member Avatar for triumphost

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 …

Member Avatar for Dingbats
0
2K
Member Avatar for kandarpa

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.

Member Avatar for triumphost
0
11K
Member Avatar for jream1

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 …

Member Avatar for jonsca
0
174
Member Avatar for triumphost

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 …

Member Avatar for triumphost
0
175
Member Avatar for silverpanda

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 …

Member Avatar for jonsca
0
387
Member Avatar for woody0114

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 …

Member Avatar for woody0114
0
126
Member Avatar for kutuup

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 …

Member Avatar for mike_2000_17
0
130
Member Avatar for g_u_e_s_t

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 << "*"; …

Member Avatar for chrjs
0
121
Member Avatar for DKDeath

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 …

Member Avatar for DKDeath
0
395
Member Avatar for ac20734

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 …

Member Avatar for gerard4143
0
157
Member Avatar for Transcendent

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.

Member Avatar for arkoenig
0
1K
Member Avatar for purepecha

/* 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 …

Member Avatar for arkoenig
-1
1K
Member Avatar for DKDeath

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 …

Member Avatar for DKDeath
0
897
Member Avatar for donaldw

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 …

Member Avatar for donaldw
0
415
Member Avatar for grebote

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 …

Member Avatar for grebote
0
219
Member Avatar for trebor-pl

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 …

Member Avatar for trebor-pl
0
1K
Member Avatar for NickOOOShea

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, …

Member Avatar for setherith
0
111
Member Avatar for htq2511

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 …

Member Avatar for pseudorandom21
0
167
Member Avatar for determine

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 …

Member Avatar for user422
0
147
Member Avatar for Najeeb gb
Member Avatar for Ancient Dragon
-2
34
Member Avatar for MaDo4

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 …

Member Avatar for MaDo4
0
120
Member Avatar for tomtetlaw

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 …

Member Avatar for Ancient Dragon
0
114
Member Avatar for Dexxta27

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 …

Member Avatar for Dexxta27
0
153
Member Avatar for jubba_us

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 …

Member Avatar for triumphost
0
155
Member Avatar for coolbeanbob

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() % …

Member Avatar for sfuo
0
4K

The End.