49,757 Topics
| |
I need to write a C++ program. I'm usually pretty decent with C++ but with this one I'm lost. I have to write a program that basically checks to make sure that the braces creating a block in a cpp file are balanced. I'm not looking for anyone to write … | |
Hello, I am a newbie in C++....I am trying to modify program to read in upto four words or 30 characters into a string and then print it out. Here is the code..... [code] #include <iostream> #include <conio.h> using namespace std; int main() { bool isWord = false; char ch; … | |
Ok i have been working on this for a few days and can not get my main right. I have tried so many diffrent things and couldnt get it any help is appreciated. Design, write, and test a program that simulates some aspects of a simple savings account in a … | |
Greeting All, Peace. New to this forum and am confused about how to approach data analysis of variables with C++. My question I is am simply going to do simple descriptive statistics (mean, mode, variance), and a little more complicated chi square / correlation (Pearson). The approach that I am … | |
Hey guys, I was wondering if the stringstream class copied the string to itself or just keeps a pointer. Because if it copies I can free or clear the string without fearing for the data in stringstream. EDIT: Like this: [code=cpp] string stringz0r("Chickenz"); stringstream streamz0r(stringz0r); //will this not affect the … | |
Ok, new to C++, I bet this is a real easy question. Every time I input a char, it enters the same char twice to variable. So when I enter "r", and then output it..it outputs "rr" [code=c++] #include <iostream> #include <fstream> using namespace std; #define errorMsg1 "You must enter … | |
I'm new to C++ and I can't seem to find the problem with my code. I have a function that opens an input file. It asks you to input a file and if it can’t open the file it asks you if you want to try again. If you answer … | |
I am trying to set up an emailprogram, the first code that I try to compile is this where I set an emailTo and emailFrom in the arguments of MailMessage. When I compile this code, I have an errormessage that says. [I]'System::Net::Mail::MailMessage' : class does not have a copy-constructor[/I] What … | |
Write a program where the user enters numbers (doubles) on standard input. All of these numbers should be greater than zero, except for the last one, which should be -1. The -1 is a sentinel value and is how the user signals that he or she is done entering numbers. … | |
Hello, I am working on something where i need to search and replace many variable names of a program. For example, I have a class [B]Hello [/B]and its public variable is [B]world[/B], but the variable world has been changed to [B]earth[/B] so now in the program i need to go … | |
If you want to run 2 loops at the Very same time in C++, will backgroundworkers have this functionality ? An example could be how I have set up it in this code. What I wonder is if the backgroundWorker1 first is executed and when this is finished, then backgroundWorker2 … | |
To all the Masters, Sir can you help me in this problem, the program tells the infix to convert into postfix. ex. a+b-b*c+g/s =[U]ab+bc*-gs/+[/U] My problem is, once you compile the program there is no error message, but if you run it, the output did not show. I know this … | |
Hi, Okay I have problem with my homework. In the code i need to run either object2 or object1. Its a shooting game made in turboc. So if I hit keys a,d or space, i need the tank to move and otherwise i need the object to come down. Thanks | |
Hi I have problem at pointing to the function at the class structure. To demonstrate my problem,I have written a simple code. I have two function. ''Xsquared'' returns square of input value. ''multipleby4'' multiplies by 4 of input value. The pointer to the Xsquared is the input value of the … | |
Hello, can an exe statically linked by c++ or code blocks run on a mac? if it requires a software to convert it, which would you suggest? Thank you for any help. | |
I am just getting started with C++, so please explain things to me in the most basic way you can. I really don't even know where to start to be honest. Below is a problem that I would like to learn how to code. Examples are welcome. Thank you. Suppose … | |
[code=cplusplus] include <iostream> main () { int a, b; bool found; cout << "Enter two integers: " cin >> a >> b; if a > a*b && 10 < b found = 2 * a > b; else { found = 2 * a < b; if found a = … | |
Hi, I'm trying to do a program where I have to input 4 lines of text from a txt file, char by char into 4 seperate arrays (1 for each line). I have this [CODE] ifstream input("c:\\p2input.txt"); for (int z = 0; z < 250; z++) { while (!input.eof()) { … | |
Hi, I try to generate uniform random number between 0 and 1. I wrote this code but it creates only numbers at the 0.1***. Generated number always have 0.1 and remaning numbers change, like 0.1234, 0.13444,0.143334.... Can you show me show how can I generate these numbers (uniformly) at (0,1]. … | |
Hello and thanks in advance for your help. My program calculates the gratuity of various bills and gives the user how much to leave for a tip. If the user enters a negative amount for the tax, the default constructor is supposed to use 6.5%. My program compiles, but instead … | |
hi, Please tell me why an empty Structure will occupy 2Bytes in C++ Thanks | |
hello i wrote a c++ program, and i wanted to send it to my friends, but everytime i send the exe file to them, they tell me they get the error: "The application has failed to start because the application configuration is incorrect". I tried to put it on rapidshare, … | |
Hey, could I have a little help please. What I'm trying to do is display a message if the user clicks their mouse, I have: [CODE] int main() { mouse_event(MOUSEEVENTF_LEFTDOWN, x, y,0,0); } [/CODE] How would I get it to display a message? I'm thinking an if statement but dunno.. … | |
Hi all, my name is Karim, and I am migrating from Python to C++ in order to make windows and linux based games. I am using the Visual C++ IDE, and am a complete newbie when it comes to C/C++. Python is so overly simplified that it does not provide … | |
Hi, I'm completely new to C++, which I'm doing as part of a numerical methods course. I have experience with IDL, so I clearly like languages with training wheels :) I'm running the GNU C++ compiler under Ubuntu 8.04 on a Dell XPS. I've made my first program run, but … | |
Hello all, I'm python guy learning C++ so be patience with me. I am just asking if this GUI builder can be used to make Big app like Thunderbird wihtout external assistance [url]http://wxformbuilder.org/[/url] | |
how would I go about making a variable in a class, that could be read directly but not written as such? Like, [icode]if(class1.variable==true){ }[/icode] is allowed but [icode]class1.variable = true;[/icode] is not... however I don't want a [icode]const[/icode], I want it to be able to be set from within the … | |
[CODE]TCHAR exepath[MAX_PATH]; GetModuleFileName(0, exepath, MAX_PATH); HKEY hKey; LONG lnRes = RegOpenKeyEx( HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0,KEY_WRITE, &hKey ); if( ERROR_SUCCESS == lnRes ) { lnRes = RegSetValueEx(hKey, "YourProgramsName", 0, REG_SZ, exepath, strlen(exepath)); }[/CODE] To add as a HKLM (For all users) startup item instead of HKCU (Current User), change HKEY_CURRENT_USER to HKEY_LOCAL_MACHINE. … | |
Hi, all i have the assignment about program which reads in integers from cin until the user enters a non-integer (a character or EOF), then print out the average. Its pretty simple assignment but i am kind of new. So the following is my code and seems like have some … | |
For some reason my if statement in both my [I]unionFunction[/I] and [I]intersectFunction[/I] is setting the array equal to 1 rather then comparing it. I've tried to figure out whats wrong but nothing seems wrong to me. I appreciate any help. Here is my program so far: [code] #include "stdafx.h" #include … |
The End.