49,761 Topics
| |
It's my revision question. Please help... Create a Class Employee. This class holds member variables: employee number and salary. It has an array of 4 employees and includes 4 employee number and salary. Has 2 member functions: Get() employee detail, namely number and salary Display() employee detail Create main() I'm … | |
Correct me if I'm wrong but... Each time I declare an object without assigning it a value, I am instantiating it (so long as the valid constructors is called upon doing so--) like... [code=c++] Triangle tri1 (3, 4); [/code] and this object exists on the stackk but only for the … | |
I am using Borland C++ Builder. I am trying to get the filename of an Image. How do I do that? (e.g Label1->Caption = Image1-> ????) Thanks a lot | |
How do you write a C++ program that converts uppercase letters to lowercase using the following function header: char upperCaseToLowerCase(char ch) | |
is there a way to "resize" a lib. string? is there a way to limit/set its size to a value? umm, and yeh, is there a better algorithm to search for all substrings in a string than this one i've made: [CODE] for( int i = 0; i < s.length(); … | |
Hello, I am new to proogramming and I need read the elements from two csv files into a 2 vectors and display the elements of vectors. The csv file is in the following fomat: 200, New york, -23.456, 23.455 201,Chicago,-34.5434,34.546 ..... ..... After that I have to perform string matching … | |
hi i created an application in vc++/MFC now iam using ado to connect to the databaase but there is aproblem i couldnot find any solution for it ....pleeease help the problem is this error : [B]error C2146: syntax error : missing ';' before identifier 'm_pConn'[/B] while iam defining : [B]in … | |
recently i was reading a tutorial about the ole api and i think i managed to get through the whole tutorial but when i try to use some of the functions the tutorial uses like oleuninitialize then i get an error saying undefined reference i would like to know what … | |
I need some guidance in a little project. I want to make a Document/View project that opens some planing files. I want the view for this files to be something like an excel sheet so you can modify the values of some fields and then be able to call some … | |
Hello, I am having the following problem with calling my function to return the salary it calculated depending on the switch statement. I don't understand the error: ": error C3861: 'getSalary': identifier not found" [code] double Salary::getSalary() { return salary; } void Salary::compute() { cout << "Enter the employee's paycode … | |
I have this error : "no appropriate default constructor available " in Form1.h. Form1.h [code] #pragma once #include <time.h> #include <windows.h> ref class CCenter; namespace RCK { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Summary for … | |
hello i have just started learning c++ .But Im not able to get any good compiler for c++.Can anyone out there help me by suggesting me a good website from where i can download c++. | |
The error is listed in the title and then commented in main (last comment). The program runs but once it encounters the bool expression I overloaded, it seems as if the program pauses. I have a feeling it's a stack overload due to the way my function operates, but I … | |
I'm trying to use fstreams to read and write binary data to a file with the following code: [CODE]#include <fstream> #include <iostream> using namespace std; int main(){ ofstream out("test.data", ios::binary); for(uint i=0; i<10; i++){ uint outcount = i+100; out.write((char*)&outcount, sizeof(uint)); } ifstream in("test.data", ios::binary); for(int i=0; i<10; i++){ uint incount; … | |
In VC++ 2008 Express, I open a new "Hello World" project (CLR Console Application). If I right-click the project in the solution explorer, and select "properties", I get a "... Property Pages" window which shows a line entry for: Configuration Properties / C,C++ / General / Additional Include Directories. It … | |
I have a vector<classType> vect in order to call sort( vect.begin(), vect.end() ), what needs implemented in the class classType? I have the overloaded operator< and a copy constructor, but the problem i get is that some member variables of classType that are pointers dereferenciate during the call to the … | |
Ok, I am building a text based rpg. This an excerpt from my code. at one point it asks what your name is. When you type that in I put it into a string variable called name but I want to be able to save it to a binary file … | |
Hi, I have a readFile() function that reads a csv file into a vector. The first two lines of the csv are collum headings. After reading and displaying the file on screen, replacing ","'s with spaces, it asks if the user wants to append new entries. If yes, it calls … | |
i want to be able to create dynamic buttons. so ive used the code : [CODE]TButton* Btn = new TButton(this);[/CODE] my first question is: how do i assign a function to the dynamic button?! my second question is how can i put the code into a loop as to be … | |
i learn c++ chapter in objects and classes but i read previous chapter functins i have a problem i this chapter following code: [B][U]writer once time write the code:[/U][/B] return 0; [B][U]second time write the code in another programme:[/U][/B] return 0.569575 * pound this code programme in line 7. please … | |
yes I'm tryint to learn c++ and I wanted to ask someone a question, I'm on functions, and so far when you do the return statement it says return 0,, and it started saying return and then a variable and the way it seems to say it , it changes … | |
I have heard about the: char myline[100]; cin.getline(myline,100); but when my coding is long it doesnt work i gues as long as i would like it to? here is my code for example: [code] #include <iostream> using namespace std; int main() { int length; int width; cout << "Enter the … | |
hi all i am using VC++ editor. Can anyone tell me how to insert sleep in my program? i have tried sleep(). but it is giving an warning 'sleep' undefined; assuming extern returning int. Thanks in advance | |
Hi !!! I have so strange problem... i dont know what i have to do.. Quote from[B] form1.h :[/B] [code] #pragma once #include "Center.h" #include <time.h> #include <windows.h> namespace RCK { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// … | |
Help - the static_cast< double > is not calculating the value of term and I cannot see what is wrong. [code] void eConstant::compute() { cout << "Enter the desired level of accuracy to calculate the mathematical constant e, \nmeaning the number of terms in the summation: "; cin >> accuracy; … | |
Hi... I want to create windows service for my abc.exe through programaticaly in c or c++ how to do this??? | |
Hello, I've written a short app that (in theory) connects to a remote box on port 23, and simply reads what is returned. The ultimate goal is to log on to the box automatically in order to automate some of my less interesting tasks. I get the socket set up, … | |
I'm trying to skip part of my loops by using continue; however, I am unsure where how much code each continue statement skips. My suspicion is that, in the below code, the continue statements effectively do nothing and put my code right before the return false statements. I have marked … | |
3.6 * vector_a; why can I not implement this binary operator as a member operator of a class Vector? [code] class cycle { cycle(); ~cycle; pedal(); }; class bicycle { bicycle(); ~cycle; pedal(); }; bicycle *bikeptr = new bicycle; cycle cycleptr=dynamic_cast <cycle>bikeptr; cycleptr->pedal(); [/code] Okay, here are the questions I … | |
I've got a pretty simple question. I'm trying to ask the player for to choose a difficulty. I want the case to be to not affect his choice, so I am using the toupper() function. Unfortunately, when I try to return the value of the difficulty, no matter what difficulty … |
The End.