49,761 Topics
| |
See the highlighted portion (in yellow) the definition of copyConstructor at http://libraryofcprograms.blogspot.com/2013/03/copyconstructor.html Why haven't we used obj.getX() ? void a::copyConstructor(a &obj){ x = obj.x; //should have used obj.getX() because we're accessing a private member of obj? } | |
add the functions to overload the increment and decrement operators to increase the date by a day and decrease the date by a day, respectively; relational operators to compare two dates; and stream operators for easy input and output. (Assume that the date is input and output in the form … | |
Create the logic for a program that prompts a user for three numbers and stores them in an array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the main program | |
Hello Everyone, Off the bat I want to say that I am just learning programming so if my code is missing basics I apologize. I was hoping that you might be able to give me an example of how you would solve this problem. I've spent the better part of … | |
I am running Visual C++ 2010 Express on Windows 7 Ultimate SP1 32-bit. I have written a small program aimed at reading the contents of a given directory. However, while the program compiles correctly, it will not run as it says that opendir, readdir and closedir are unsatisfied externals. What … | |
Hi Iam using visual Studio 2008 professional edition in which iam working with visual c++ projects. I want to generate class diagram for the project. Class diagrams are working fine with c# and VB projects but its not working for c++ projects. I created fresh projects and tried to generate … | |
I need help creating my operator+ function.The first thing i did was send the binary numbers to the reverselist funtion, but i ended up getting some errors. Binary.cpp: In function `binary operator+(const binary&, const binary&)': Binary.cpp:164: error: invalid initialization of reference of type 'nodeType*&' from expression of type 'nodeType* const' … | |
is there any way one could do a square root program without sqrt or pwr functions? Any tips? I am not asking for code btw.:) | |
I know that there are plenty of open source implemenations of AVL trees out there but I was wondering if it is possible to have a AVL that has repeat entries. I want to use one so I can search records by various fields. Eg I would have one for … | |
I have a vector<purchases> v where purchases is defined as: struct purchases { string name; int amount; string item; }; vector<purchases> v; I need to find the 3 top buyers. ie. the name of the top 3 people with the highest accumulated amount. The problem I have is when I … | |
Hello, I am working on an arbitrary precision arithmetic library. I already created a version that just stored numbers as "before decimal point [unsigned array]" and "after decimal point [unsigned array]". The issue is that it is both inefficient and incomplete. I would like to incorporate complex numbers into the … | |
Hi, I am implementing an applicaiton which uses CPU but having a problem about allocating in GPU memory. Above all, my work environment is Windows 7 Visual Studio 2010 NVIDIA Quadro NVS 290 (256MB) When I run a piece of CUDA code: cudaMemGetInfo(&freeMem, &totalMem); I get 256MB of total memory … | |
Greetings, My name is Micah, I live in the US and I am a recent graduate in the field of Computer Science. I have experience in C++, C# and Java but only basic console programs and minor OOP. I have a little database administration experience. I currently work in the … | |
Hi all, I will be using the USRP Software Defined Radio to receive satellite signals for a project. I have been looking around, but I can't seem to find any tutorials that can help me do this. I know that the USRP's have an API that interfaces c++, but have … | |
Here are the errors Binary.cpp: In function `std::istream& operator>>(std::istream&, binary&)': Binary.cpp:24: error: `nodeType*binary::head_ptr' is private Binary.cpp:114: error: within this context Binary.cpp:24: error: `nodeType*binary::head_ptr' is private Binary.cpp:115: error: within this context Binary.cpp:115: error: call of overloaded `list_clear(nodeType*&)' is ambiguous Binary.cpp:28: note: candidates are: void list_clear(nodeType*&) Binary.cpp:56: note: void list_clear(nodeType*) Binary.cpp:24: error: … | |
how to downalod windows.h header file | |
Hello, I need help to read entire string line with white spaces. I tried many ways but they didn't work :| If I remove `cin>> company_name;`the run jumps to `std::cout << "Enter the symbol of the company: ";` without completing reading company_name from the user! AND, If I keep `cin>> … | |
1. What happens when you add an element to a vector that is already at capacity? Does std::vector have a "capacity"? 2. In C++ and OOP in general, what do you call a design where a Person class inherits from Head, Arm, Body, Leg classes instead of the other way … | |
These are the errors that i am getting J:Project 2Binary.cpp: In constructor `binary::binary()': J:Project 2Binary.cpp:37: error: no match for 'operator=' in '((binary*)this)->binary::head_ptr = 0' J:Project 2Binary.cpp:6: note: candidates are: nodeType& nodeType::operator=(const nodeType&) J:Project 2Binary.cpp: In copy constructor `binary::binary(const binary&)': J:Project 2Binary.cpp:43: error: invalid initialization of reference of type 'nodeType*&' from … | |
I have develop a functor array without class but fail to write a functor relate to class. Here is the code without class int returnOne (void) { int a = 0; a++; return 10; } int returnTwo (void) { int a = 0; a++; return 20; } typedef int (*functor2) … | |
Hi there I have a C++ code and I need to write it in C to do the simulation. Can anyone help? Thank you so much. and for random.hpp I will replace that with random.c (a random number generator in c) #include <cmath> #include <cstdlib> #include <fstream> #include <iostream> #include … | |
i installed codeblocks on windows8 but when i compile one of c program error message mingw32-g++.exe: Internal error: Aborted (program collect2) the same problem happened on devc either what will l do | |
How many bytes of memory is allocated when you declare: double* p1[10]; | |
I am trying to get each elemnt of a text file with 13 integers in one line, each seperated by a space, into each slot of an array, any idea how to do this? | |
In the following program I declared "long" for a, but still getting incorrect negative output after the 1860th term (all are supposed to be positive). What is the cause? int main() { for (int i=1; i<=2000; i++) { long a=i*i*i/2-3*i*i/2+3*i-1; cout << setw(3) << i << "\t" << setw(8) << … | |
I've written bucket sort, to read a list of numbers from a file, sort them, then write the sorted list to a new file. My program runs through the process just as it should, but whenever a bucket is completely sorted, it doesn't save the changes in the bucket. My … | |
Hello everyone I am trying to make a app. witch uses windows that pop-up if a button is pressed. the problem is, i don't know how to make more than one window. Can anyone tell me how to do that? I am using Microsoft Visual Studio 2010 Express, in a … | |
Hello, I'm building opencv library with cmake for mingw to be used with qt and i've been able to generate the makefilelist. But when i type **mingw32-make** at the command prompt i get error when it's 44% built. error says: *Cannot export _ZN12_GLOBAL__N_13R)p3aLLEv: symbol not found Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol … | |
Hi, I have a problem compiling the "pjproject.sln", and I have the following error appearing: "fatal error LNK1104: cannot open file 'dsound.lib'" Build log was saved at "file://c:\Users\SLF101\Desktop\PJ Project\pjproject-2.0.1\pjmedia\build\output\pjmedia_test-i386-Win32-vc8-Debug\BuildLog.htm". Could anyone help me solve that problem? It seems like it does not want to open the "dsound.lib" file everywhere. That … | |
when we press the button ,then appear like this private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { } after that if we want to appear the caracter like "A" , after press the button , how is the program for that?? thank you before |
The End.