49,761 Topics
| |
Have a situation with my code, where it appears the stringstream object is not being cleared. Here is my code, this code will set an interprocess shared variable, The code is simplified to illustrate my problem, and all other variables are there to aid in that, for instance, the ints … | |
i want to do some projects in c++ ,which topic is easy to do project please give some suggestion | |
I don't know where to begin, so I'll start with what I know. First, I have a remote control. Second, a chip. The remote control has two directions, left and right. The chip receives the signal and then moves in the direction accordingly. Now, what I want to do is … | |
Looking To learn how to send data from a program to a webservers webpage. More specificly sending the data to <form> tag within a html file. Trying To Find out how to do this, code examples would be prime. Also Any Guides on connecting proxies -- who then connect to … | |
Hi all I have to write code that ask the user to input a current (that will be split into two currents) and then the output from the code should display the two resulting currents given two input resistors. That part I can do but my problem is I have … | |
K so atm, I'm having problems understanding ENDIF and IFDEF preprocessor stuff.. I want to Use a specific method if a file is included.. If not, use a different method.. Since toupper is defined in CCType I tried to check if that file was included.. if it was, use toupper … | |
I have a question, I have a working application. I am using a splitcontainer with multiple different Panels inside of it. When a user clicks a button the following code is executed: [CODE] this->panelnameA->Visible = true; this->panelnameB->Visible = false; this->panelnameC->Visible = false; [/CODE] Now my question is lets say an … | |
I wrote this code for a homework problem. The question asks for the inputs to be an array representing a polynomial along with the degree of the polynomial and the value of x. Then it has to return the derivative of the polynomial. Until I ask the program to output … | |
this program works but i need to put in a loop that the user 10 times to input a value and you load it ino an array #include<iostream.h> #include<conio.h> //Author: //Object: //Date: void ctof(void); //function declarations (prototypes) void ftoc(void); float c,f; // (outside the functions) main() { int option; //--------------output … | |
how to print the sum of odd and even numbers taking upper and lower limit from user | |
Hi guys just wondering if anyone could give me some tips on starting a moveable char function for my maze game. I wish to create a function that allows me to move the player through the maze shown below. I have a few ideas on how to do this however … | |
Hey there! I'm trying to figure out how to get a random letter generator for a program I'm working on in my computer science class (it's in C++). I need to generate 5 random capital letters between A and P (A, B, C, D, E, F, G, H, I, J, … | |
What did I do wrong? Can anyone please explain to me so I can learn? [CODE] #include <iostream> #include <string> #include <cmath> #include <math.h> #include <algorithm> using namespace std; class Distance { private: int length; public: Distance(int length = 0); int operator *(Distance My_Trip); int trip_length; }; int Distance::operator *(Distance … | |
Hello everyone, Ok my problem is that I do not get how to convert an array of characters to a string arrays. Like I do not get how to assign a null character at the end of a set of characters... how do I incorporate punctuation, spaces etc in this … | |
Hey all! I was thinking about how to make a program, in which you write some c++ code and program tests that code with given examples. For example you input following code in that program: [CODE]#include <iostream> using namespace std; int main() { int a, b; cin >> a >> … | |
Here is the code of my binary tree can any one plzzz write the delet function for it..... i tried my best but..... [CODE]#include<iostream> #include<stdio.h> #include<conio.h> #include<Windows.h> #include<stdlib.h> using namespace std; struct st { int marks; st *left; st *right; }; struct st * create() { struct st *p=new st; … | |
I am having trouble with writing a tic tac toe program. My code executes just fine if the first move results in a win. If it doesn't the code just stops. It doesn't finish but it does not continue to run. Can someone help? Must start with the game board … | |
[CODE] vector<string> guess(4); cout << "Input a Guess(e.g red blue green yellow): "; cin >> guess[0] >> guess[1] >> guess[2] >> guess[3];[/CODE] this is part of my code to let the user input 4 different guesses, is there anyway I can limit the input by 4 so that if the … | |
Hey forum, I'm very new to C++, and I need some help. I'm currently having trouble trying to write a Caesar cipher in C++. So far, I'm able to get it to read characters from a text file, and let it count the # each letter appears in an array. … | |
Dear friends, These days ,I am learning something related to linear list.In implmenting the function of realloc.I have been pullzed for several days,although I can use "include" method to directly use the function. However , I deeply wonder that how can I write my own code to solve such questions in … | |
interchange fist and the last rows and coloums in a 4X4 matrix | |
Hello.. I have created a file using Core WIN32 & code is like this : HANDLE hFile = CreateFile("E:\\FileName123.txt", GENERIC_READ,0,0,OPEN_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); This will create a file with name FileName123 in E:Drive. My question is: When it will create the file in E:Drive, it must become Copy Protect. That is., … | |
Hello All, I am trying to read a short inventory list from a .txt file into a class of objects. To be plain and simple, I have no idea how to get the details in the file into objects to I can prompt for the pluCode and quantity to use … | |
Problem: "Error highlighting on the go" not working (Syntax, Semantic & Type errors). IDE: Microsoft VC++ 2010 Express Edition + MSQL Basic. So far: Googled & Went through options in Options>>Text Editor>>C/C++>>Advanced. So please help me.... How can i turn it back on??? | |
i'm writing a program in c++ using linux and i face the following issue: i want to tell the difference between a hard link and a file,given a path. To be more specific, i consider that it is the file itself when there's only one hard link pointing to the … | |
[ICODE]#include <iostream> using namespace std; void GetRoomTiles(int WidthFeet, int WidthInches, int &TotalWidth, int LengthFeet, int LengthInches, int &TotalLength, int TileSize, int &RoomTiles); void GetTotalTiles(int RoomTiles, int &TotalTiles); void GetNumberOfBoxes(int TotalTiles, int TileBoxes, int &ExtraTiles, int &NumberOfBoxes); int main() { int NumberOfRooms; int TileSize; int WidthFeet, WidthInches, TotalWidth; int LengthFeet, LengthInches, … | |
I am trying to building this program to run 10 times and then calculate at the end with needHelp if 75% or more was correct or incorrect. For each random number multiplication question correct and incorrect messages come up. I have been working on this for 3 days and it … | |
[code=c] #include <iostream> #include <sstream> using namespace std; int main(void) { string str; int i; cout << "Enter an integer: "; getline(cin, str); while(true) { stringstream ss(str); if (ss >> i) { break; } else { cout << "\nPlease enter a valid number: "; getline(cin, str); } } cout << … | |
Hi guys, I was wondering if this was a good place to use a goto statement? I know this will get stuck in an infinite loop eventually and I am working to fix that right now. However I wanted everyones views on whether or not this is acceptable, the goto … | |
[QUOTE] 1. Print the following heading at the top of the output page: Miser Corporation Payroll 2. Read an unknown number of employee data records as shown below. Each group of data will contain an employee's name, hours worked, rate of page and age. A typical group of data will … |
The End.