49,761 Topics
| |
I need a code which will print union of two strings. for example string1="1,2,3" string2="3,4,5" and print the result string3: 1,2,3,4,5 Could someone help me how to solve this? | |
Hey, I'm a bit rusty at c++ and I'm sure that I'm just missing something stupid, but I have a class that takes in an ifstream object in its constructor. In my main function I create an ifstream, open a file, then pass the ifstream object by reference into the … | |
Hello everybody. I've a question. I tried to change font size of textBox named "textBox1" Here is the function of the NumericUpDown: [CODE]private: System::Void numericUpDown2_ValueChanged(System::Object^ sender, System::EventArgs^ e) { String^ Num2 = this->numericUpDown2->Text; this->textBox1->Font->Size = Num2; };[/CODE] Errors that occur: [CODE] error C2039: 'set' : is not a member of … | |
Hi, I'm trying to write a program that converts a base x to a base y. It says that we are suppose to use two functions to do so: one that converts base x to base 10 and one that converts base 10 to base y but I don't understand … | |
I had code in C++ which works really. I need to find alternative solution for this kind of solution... Could some help me how to change the code ... [CODE]#include <string> #include <iostream> using namespace std; int main(){ string s1="abv"; //Set up string 1 string s2="vxz"; //Set up string 2 … | |
Hi.. I have an image of what my code is drawing attached, although the code is meant to draw multiple trapeziums and now the extra line lol. I was wondering if anyone could tell me where i was going wrong. Here's the code.. [CODE]void DrawPolygon(POLYGON *p) { int current_Left, current_Right; … | |
I am trying to make a recursive program that prints out the numbers from 1-100 without using any iterations such as loops, but every-time it just keeps printing out 5050..? [CODE] #include<stdio.h> #include<stdlib.h> int counter(int num); int sum=0; int main(){ int result, num=100; result = counter(num); printf("%d", result); system("PAUSE"); return … | |
I want to start C++, and I already know a fair amount of Java. So I ordered the book Accelerated C++ because I've read that it's a good book. But I was told that It's not a very good first c++ book? The only other c++ book I have access … | |
This code finds the sum & average of the range of numbers that were chosen. I have int begin = 0, end = 0,sum = 0.0, avg = 0; because I get an error saying that all of those need to be initialized, yet by doing so it gives me … | |
Hi everyone, I'm having issues incorporating something required by my assignment. I am supposed to create a class that has 2 private data members. One should be an array of 10 Database (Database being the name of the other class) objects. The other should be an integer that assigns the … | |
OK so im measuring how much time on some part of my program and it only shows me microseconds. i want to know how can i change this so it would give me seconds something like this "1.0325 second its what i want, not 1035000 microseconds any help will be … | |
can anyone tell me why my code would output the string designated plus ten or more characters of non sense at the end of it? my code also has a header with #include statements and a main that calls the functions. #include "String.h" //Default constructor String::String() { Text = NULL; … | |
I'm having an error on my displayResult function. In the line: [CODE]cout << setw(17) << static_cast<int>(exptRoll[value-1] * intRepeats);[/CODE] I have a C2109 error (subscript requires array or pointer type. Does anyone how to solve this problem? [CODE] void displayResult(const int arraySize, double frequency[], double expected[], int intRepeats, double exptRoll) { … | |
Hello C++ master out ther i need help guys this exercise is running but the desplay record is in row i want it in column. Thanks in advance! [CODE]#include <iostream> #include <fstream> #include <cstdlib> #include <string> #include <iomanip> using namespace std; char book_no[5]; char title[30]; char author[20]; char publisher[30]; char … | |
So here is something I am writing just to get back into code and I can't find the flaw with it. [CODE] template<typename T> class Array { public: Array(unsigned arraySize): data(0), size(arraySize) { if(size > 0) data = new T[size]; } ~Array() { if(data) delete[] data; } void setValue(unsigned index, … | |
Hello guys!, so this is my problem, i'm trying to make a paint-like program in C++ using the WinBGIm libraries (im using Dev-C++), so i need to program a paint brush. Here's what i've managed to code: 1)Create a canvas 2)Create a clickable button (it just returns if it is … | |
Hi everyone, I'm trying to to output an entire character of arrays in my program. I am using a header file with my class, and a source code file for my method definitions. Here are the relevant parts. The method definition for getName() [CODE] char Account::getName() const { return *AccName; … | |
Hello people. Does anyone know if it is possible to post a variable to a c++ http tunnel or http connection. In php you can do this when you want to qualify someone on an email varification. People do this in a message so when someone clicks on the link … | |
Hi iam facing the problem while compiling the below program, program.h ------------headerfile typedef struct { unsigned char c ; unsigned int i ; unsigned long l ; }data_t ; program.cc ------c++ file # include <iostream> # include <malloc.h> using namespace std ; # include "ptr.h" int main() { data_t data[] … | |
Hello, I'm working on a project and the value of num is AdditonalAdultQty + AdultQty (AdditonalAdultQty and AdultQty will be inputted from the user) Then those two values will be stored in the text file. When the program runs again and a different user will input how many tickets he … | |
Hi everybody, I need you to answer these questions please. 1- How did you learn c++ : a-books b-videos c-in school or university d- other : 2- How did you feel when learning : a- Bored b- Interested c- other : 3- Was it the first language you learn ? … | |
Ok. First off, here is the question I am answering Problem 3: Write a program that will read monthly sales into a dynamically allocated array. The program will input the size of the array from the user. It will call a function that will find the yearly sum (the sum … | |
I have to write a program that should read test scores students received on the first quiz into an array. Assume that up to 30 students could be entered. Input will stop when the sentinel value -1 is entered. Write functions to: 1. Read the original scores into arrays 2. … | |
I'm tryng to statical link libcurl but im getting some errors... I've done that: [url]http://i39.tinypic.com/25ztkbm.png[/url] [url]http://i43.tinypic.com/2nsugyq.png[/url] [url]http://i40.tinypic.com/a24v4n.png[/url] [url]http://i43.tinypic.com/1fx1lt.png[/url] Why im getting the error in the 4th picture :( ? | |
I have here a problem... i have a notepad containing values such as: tom,a1001,1 charles,1002,2 I used getline() and used the delimiter comma to separate them and store it in line variable.. my problem is that how can i store the delimited strings from line variable to any different variables.. … | |
I'm having problems reading or writing files in my C++ program. I'm using Fedora 16 on a USB stick and Eclipse for C/C++ developers. Here's snippet of code from my program. fp is always 0. I've also got other code that is loading files (which always fail). I've tried running … | |
I have designed a dialog in Qt designer and I want to use the name of each child widget for some coding in cpp file. But the names I have given to buttons etc in Qt designer are not working as pointer.More over their names in ui_[I]mydialogname[/I].h are not the … | |
Hi. I made a program and I write this code in order to make the window's size fixed. More over i am using a button to unhide some Groups on main window, But when i compile program, it crashes but when I comment out this line of code the program … | |
Please help to those who know how to code or those who are brilliant in c++ to code a beep or a sound in a borland c++ cause i want to learn how to make or to code it; and i don't have a background of coding a beep, please … | |
im having trouble timing my loop, note, this is just part of my main file [CODE] #include <iostream> #include<sys/time.h> struct timeval tv1, tv2; struct timezone tz1,tz2; long totalT; int const times = 500; gettimeofday(&tv1, &tz1); for ( int i = 0; i times; i++) { //do something, } gettimeofday(&tv2, &tz2); … |
The End.