I have a problem with my assignment. I would like to ask how to transfer positive and negative values from array temperature to arrays positive and negative?
#include <iostream> #include <iomanip> using namespace std; int main(){ int n=0, d=0, temperature[20], sum; int positive[], negative[]; float avg;
#include <iostream> #include "curve1.h" #include "curve2.h" using namespace std; int main() { Curve1 curve1Obj; Curve2 curve2Obj;
[Code]...
Base class Score has two derived classes Curve1 and Curve2. There are two curve() functions, one is in Curve1 and other in Curve2 classes. getSize() returns the value of iSize.
My base class header score.h looks like this:
#ifndef SCORE_H #define SCORE_H class Score { private: int *ipScore; float fAverage; int iSize;
[Code]...
You can see that I have used curve1Obj to enter scores, calculate average and output. So if I call getSize() function with cuve1Obj, it gives the right size that I took from user in enterScores() function. Also the result is same if I call getSize() in score.cpp definition file in any of the functions (obviously). .....
The problem is when I call curve() function of Curve2 class in main (line 23) with the object curve2Obj, it creates a new set of ipScore, fAverage and iSize (i think?) with garbage values. So when I call getSize() in curve() definition in curve2.cpp, it outputs the garbage. .....
How can I cause it to return the old values that are set in curve1.cpp?
Here is my curve2.cpp
#include <iostream> #include "curve2.h" using namespace std; void Curve2::curve() { cout << "getSize() returns: " << getSize() << endl; // out comes the garbage }
Can I use a function to simply put values from old to new variables? If yes then how?
I am not getting all the records.... when i select the same date in both datetimepicker no record is displayed... i also want the record of the selected dates from both datetime picker..
So. I have a CSV Parser that I built. It works very well. The way it currently works is that I have the parser in a header file "CSV_Parser". So my .cpp code would look like this:
#include <iostream> #include <eigen3/Eigen/Dense> #include "CSV_Parser.h" using namespace std; using Eigen;
[Code] ....
This all works great. I am running Eclipse in Linux (Xubuntu to be precise). In the header file the .csv is opened as follows:
What I would like is for the user to be able to change the file that the parser is opening through the main .cpp file. In other words, is there a way to create some variable, say "FileName" and do the following:
I am trying to display my name using outfile vs. cout and I get errors I don't know how to fix. Here is the code:
//This program will calculate the monthly payment, the total amount paid back over the entire life of the loan, // and the total interest paid over the life of the loan. #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { ofstream outfile;
[code]....
And here are my errors:
1>z:csci207program1practice.cpp(13): error C2297: '<<' : illegal, right operand has type 'const char [16]' 1>z:csci207program1practice.cpp(13): warning C4552: '<<' : operator has no effect; expected operator with side-effect
I have created a game that functions correctly, however, for balancing and future changes, I would like to record results .txt document (its 1v1 btw). I already have code to determine who won and what I am looking for is some way to keep track of different match-ups for the different characters. Im looking for something like this:
the numbers are the amounts of wins a given character has over another character. I'm looking for code to open the .txt file and add 1 to the respective win total so I can do balance changes and such.
That's what I have but it doesn't like the fprintf function because BigEndianChecksum is an unsigned int and it wants a pointer to a const char. Is there a function similar to this that will display an 8 digit integer in a txt outfile?
I need to transfer the content from the file text.txt to file sort.txt . The data in the text.txt is "struct" (info about people)but the same data needs to be sorted by the name and sent to sort.txt by using a function .
I have to make a server-client file transfer using UDP . I have created a basic server which receives message sent by client . That's all. Now comes the major part :-
1. The message sent by client is the name of file .2. Now the server checks whether there exists this file or not . 3. If there exists it sends the file to the client and it also keeps the count of the number of requests of file made by the client . Here is the Server Code
The server reads the data from file and writes into it and send to the client , On the other end client receive the data and make duplicate of this file and write into it. But on compiling it gives error in reading the file.
I need to transfer files(mainly images) between 2 computers using their RAM with some kind of FTP. I'm using C++. I guess it's pretty a lot to explain so if you have a clear and detailed articles/videos
I'm making a program in which it will read an input from a text file and then count the numbers of spaces , characters , words . Here is what i think it would work : First i will transfer the contents from the input.txt into a string , after that i will create 3 strings which contain each of these : spaces , characters , words . Then comparing each of the contents of the intput.txt_string to the other 3 strings .
#include<iostream> #include<fstream> #include<string.h> using namespace std;
Code: void Class1::Func(shared_ptr<type1> parameter) { } or void Class1::Func(const shared_ptr<type1>& parameter) { } or Should I ever pass arguments/parameters to other objects using shared_ptr's or raw pointers?
I have a secnario where I have few tab controls one ineide the other, where my real tab pages containing the data are 4 level deep. This entire structure is dynamically built from a data base.
Now I have a tick event, on whice I want to update the data in the currently selected tabpage.
How can I find it, recall that I have many tab controls, each has a tabpage with another tab control an so forth...
Two ideas I had in mind, I though I caould generate a list of all my data TabPages and itterate it, but I failed to find an indicator of the selected tab.
Another idea was to track the currently selected tabpage via an event, but I feared that I might miss somehow the track and my update the wrong tab page.
Last idea was really unelegant - Look at the main control, get the selected tab page, find the tab control on that page via searching its controls, than find this control selected page, and do the same until I reach the 4th level.
I'm trying to find an event for the combobox when its selected value changes , but I can't seem to find the right one since I've tried several events in the dataGridView that are just triggering at the wrong moments. I need to remove the selected item from that combobox so that it doesn't get selected again at the second combobox which usually have the same items .
I am developing a project that generates questions from a database, the questions are generated with multiple choice answers. On this form I have got a textbox that reds the question from the database and 4 radio buttons that reads the possible answers from the database. The radio buttons text names are updated with records from a database table each time the "next button" is clicked.
What I want this program to do is that when the user selects one of the radio buttons, I want the system to check if the selected radio button textname equals the right answer in the database table. for example in the table there are 5 columns namely: option1, option2, option3, option4 and rightAnswer. So whenever a user selects a radio button, I would like the system to check if the selected radio button's textname equals the record in the "RightAnswer" column and if so I would a messagebox to show "correct" and if not the messgaebox to show "wrong"
This is the the way I am updating the radio button text names from the database This method is called when the form is loaded
void LoadingPossibleAnswers() { Query = "SELECT * FROM AnswersTbl"; theReader = conn.ExecuteStatement(Query); while (theReader.Read()) { radioButton1.Text = theReader["Option1"].ToString();
[code]....
This method is called when the button is clicked
void CorrectAnswer( RadioButton rdb) { string correct = rdb.Text; Query = "SELECT * FROM FROM AnswersTbl;" theReader = conn.ExecuteStatement(Query); while (theReader.Read())
[code]....
When ever I run my code above, else condition executes even if the correct radio button is selected.
when we click on a line in text area I want to open a popup having all text from that line. I should be able to select some of its text then if I click on save button of popup then only selected text should be saved and displayed in original text area of form. I want to use this for multiple sentences of text area.