49,761 Topics

Member Avatar for
Member Avatar for MRehanQadri

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? }

Member Avatar for Nutster
0
153
Member Avatar for undeadelite

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 …

Member Avatar for undeadelite
0
4K
Member Avatar for Kangol

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

Member Avatar for asifalizaman
0
213
Member Avatar for firebird102085

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 …

Member Avatar for firebird102085
0
801
Member Avatar for normanallen

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 …

Member Avatar for normanallen
0
254
Member Avatar for jerryvdk

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 …

Member Avatar for Ancient Dragon
0
518
Member Avatar for CHOCHOCHO

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' …

Member Avatar for Labdabeta
0
680
Member Avatar for tformed

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.:)

Member Avatar for vmanes
0
3K
Member Avatar for bob89

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 …

Member Avatar for paladin.lone
0
336
Member Avatar for chrisStark123

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 …

Member Avatar for chrisStark123
0
138
Member Avatar for Labdabeta

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 …

Member Avatar for deceptikon
0
234
Member Avatar for 9tontruck

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 …

Member Avatar for 9tontruck
0
381
Member Avatar for weasel7711

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 …

Member Avatar for L7Sqr
0
297
Member Avatar for thats_nice

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 …

Member Avatar for thats_nice
0
126
Member Avatar for CHOCHOCHO

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: …

Member Avatar for Banfa
0
177
Member Avatar for vatsal.jariwala.14
Member Avatar for Sara Tech

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>> …

Member Avatar for NathanOliver
0
2K
Member Avatar for Navlag

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 …

Member Avatar for Ancient Dragon
0
212
Member Avatar for CHOCHOCHO

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 …

Member Avatar for CHOCHOCHO
0
371
Member Avatar for murnesty

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) …

Member Avatar for mrnutty
0
256
Member Avatar for hxc210

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 …

Member Avatar for mike_2000_17
0
364
Member Avatar for Şerif Burçin

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

Member Avatar for burcinerek
0
851
Member Avatar for wschamps42
Member Avatar for Banfa
0
152
Member Avatar for robjackstewart

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?

Member Avatar for ravenous
0
960
Member Avatar for sgw

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) << …

Member Avatar for asifalizaman
0
254
Member Avatar for rfrapp

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 …

Member Avatar for rfrapp
0
538
Member Avatar for kirenemook12

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for capton

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 …

0
154
Member Avatar for cargito

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 …

Member Avatar for Ancient Dragon
0
979
Member Avatar for rendykvalentino.p

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

Member Avatar for tinstaafl
0
89

The End.