Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~5K People Reached
Favorite Tags
Member Avatar for CPPRULZ

Hello I am currently making a program for a database which includes an SSN. The user can input the ssn but I want it in xxx-xx-xxxx and to make sure the user ddoes this have the user input 3 numbers then 2 numbers then 4 numbers in seperate cin statements: …

Member Avatar for ArkM
0
114
Member Avatar for CPPRULZ

It is my understanding that in C++ objects of derived classes invoke the derived class' constructor but before the body is executed the base class' constructor is invoked and takes effect and then the derived class' constructor's body is executed. If this knowledge is correct, then what happens if the …

Member Avatar for ArkM
0
94
Member Avatar for CPPRULZ

I have been trying to make a program that uses derived classes but have run into a problem. I get the error type: " error C2440: '=' : cannot convert from 'const char [16]' to 'char' " when I try and intialize a char array of 255 to "Name Unknown" …

Member Avatar for Ancient Dragon
0
114
Member Avatar for CPPRULZ

I was testing which constructors are called in when a derived and then base class objects are created. My program couted 0 if it was the base class and 1 if it was the base class. I ran it and it returned 01 for the derived class and 0 for …

Member Avatar for ArkM
0
95
Member Avatar for CPPRULZ

My textbook says "Constructors cannot be virtual. (Think about it: constructors are called to create new objects. However, if you don't know what type of object you're trying to create, how do you know which constructor to invoke?)" but I am not sure what it means by this. Is it …

Member Avatar for ArkM
0
138
Member Avatar for CPPRULZ

Hello I have been trying to understand virtual functions for a while and when I made a program to demonstrate the use of virtual functions it didn't and someone gave me this piece of code that would demonstrate the proper way to utilize a virtual function: [code=c++] #include"derived.h" #include<iostream> using …

Member Avatar for CPPRULZ
0
122
Member Avatar for CPPRULZ

I have recently learned about virtual functions and it is to my understanding that they are a keyword that goes in front of the return type when defining a function. They go in a base class, and make it so that if a member function of the base class is …

Member Avatar for nucleon
0
106
Member Avatar for CPPRULZ

Hello, I posted a program about converting furlongs to kilometers and other conversions concerning those 2 main units. These errors kept popping up: error C2027: use of undefined type 'Kilometer' see declaration of 'Kilometer' error C2228: left of '.getkilometers' must have class/struct/union error C2027: use of undefined type 'Kilometer' see …

Member Avatar for CPPRULZ
0
152
Member Avatar for CPPRULZ

Hello, I have been working a week on this program with this stupid bug that gives tons of errors. I have narrowed them down to 4 errors and 2 warnings but I have no idea how to fix the 4 errors. The program is supposed to have two user defined …

Member Avatar for siddhant3s
0
113
Member Avatar for CPPRULZ

I just have one question, when you have a class that is defined: [code=C++] class box{ public: int *value; box() { value=new int; *value=0; }; box(box &c) {*value=*c.value;}; }; [/code] If in the main you said class box b(a); it would work as expected. But I don't understand how that …

Member Avatar for death_oclock
0
148
Member Avatar for CPPRULZ

So when two objects are declared say class shoe shoe1 and class shoe shoe_copy and then shoe1's variables are set, if the line of code: shoe_copy=shoe1; what would that be doing? After all what is the real data structure of the objects of class shoe?

Member Avatar for MMahmoud
0
142
Member Avatar for CPPRULZ

If an explicit copy constructor is defined that makes a complex copy, does: [code=C++] int main() { class shoe shoe1; class shoe shoe_copy(shoe1); } [/code] And [code=C++] int main() { class shoe shoe1; class shoe shoe_copy; shoe_copy=shoe1; } [/code] Basically I'm asking if the assignment operator accesses the complex copy …

Member Avatar for CPPRULZ
0
165
Member Avatar for CPPRULZ

When a parameter in a function definition (for say class distance) is abc(distance a) and in the main you call this function and pass distance b, what is the relationship thereafter between distance a and b? Do there adresses become equal-if so what implications does that have in the program?

Member Avatar for CPPRULZ
0
113
Member Avatar for CPPRULZ

Hello I was researching the copy constructor and found this exampleo a website: [code=C++] #include <iostream> class Array { public: int size; int* data; Array(int size) : size(size), data(new int[size]) {} ~Array() { delete[] data; } }; int main() { Array first(20); first.data[0] = 25; { Array copy = first; …

Member Avatar for CPPRULZ
0
89
Member Avatar for CPPRULZ

Hi lately i have been studying the malloc and calloc functions for dynamically allocating memory. I thought the form was: [code=C] (data_type*) malloc(data_size); [/code] But then I stumbled onto this code snippet on a tutorial site: [code=c] #include <cstdlib> void *malloc( size_t size ); [/code] Why is the data type …

Member Avatar for Narue
0
374
Member Avatar for CPPRULZ

When a pointer is deleted, is the memory it is pointing to only returned to the heap or is it also nulled too? Thx

Member Avatar for Salem
0
65
Member Avatar for CPPRULZ

Say I have a class (say number) and declare a private variable (say int num) and have a public member function(say int getnum() ) that retrieves the private variable. When I in the main() without initializing the private variable int num (of course after declaring the class variable say test) …

Member Avatar for VernonDozier
0
104
Member Avatar for CPPRULZ

Hi I have to do an assignment for a course that includes that I use new stream insertion and stream extraction techniques. On the lecture notes it briefly mentioned cin.get() and getline but not in a very descriptive way. Could anyone please summarize the use of get() when inputting more …

Member Avatar for mrnutty
0
110
Member Avatar for CPPRULZ

Hello I was making a program called englishweight and it has three main components englishweight.h which is a class declaration, englishweight_def.cpp which defines the public member fucntions, and EW_driver which uses the class to calculate what to do with the englishweight and preforms very basic operations. My program works WITHOUT …

Member Avatar for Manutebecker
0
184
Member Avatar for CPPRULZ

I am getting errors that I have never seen before in a program that uses class englishweight with float number and float eng_weight to output number*englishweight and other things in the EW_driver.cpp. Here is what my build log looks like: ------ Build started: Project: assignment_2, Configuration: Debug Win32 ------1>Compiling...1>EW_Driver.cpp1>Linking...1>EW_Driver.obj : …

Member Avatar for StuXYZ
0
84
Member Avatar for CPPRULZ

OK I'm a beginner at C++ so don't mock me for this question, so when I declare a pointer ptr (int *ptr; ) and then define ptr as 5 by saying *ptr=5; what adress is ptr pointing at-a temporary variable? Thank you-just curious.

Member Avatar for JoBe
0
125
Member Avatar for CPPRULZ

Hi, I was making a pogram to demostrate static variables and I don't know why my compiler (VS 2005) is giving me these crazy errors that my book im using said I shouldn't be getting. Here is my program, please help: header: [code=C++] class number{ private: static int num; public: …

Member Avatar for grumpier
0
150
Member Avatar for CPPRULZ

I was writing a simple class to test my understanding of class and the first class program had a number -int num private- that was modified by the user by void definenum(num) and retrieved with int getnum(). It functioned as I expected-i would define it as 4 and it would …

Member Avatar for CPPRULZ
0
139
Member Avatar for CPPRULZ

Hello, I am very new to programming and want to know if anyone knows of a good internship or course that they recommend, near San Diego California preferably. Also any seminars or useful websites that would broaden my IT/programming knowledge.

0
52
Member Avatar for drkessence

Welcome to the temporary page for the official Nightmare Productions C++ Contest. What do we hope to achieve by holding such a contest? We are attempting to spread the knowledge of C++ and hopefully get others interested in it. The contest description is below. In order to enter the contest, …

Member Avatar for drkessence
0
196
Member Avatar for CPPRULZ

I've been studying enums lately and decided to make a program with it to test the enum syntax and my first one worked. It was: [code=c++] #include<iostream> using namespace std; int main() { enum daysinweek{ monday=0, tuesday=1, }; enum daysinweek enumerator=monday; cout<<enumerator<<endl; system("pause"); return 0; } [/code] It worked perfectly, …

Member Avatar for StuXYZ
0
141
Member Avatar for sting23

i have a few days to design a system(payroll) using C++. does anyone have the source code thank you

Member Avatar for ithelp
-1
135
Member Avatar for anbuninja

need help with this assignment. im having trouble with if and else. I enter package A and then it ask me for the hours twice. just run it if you dont get me. here are a few examples of how running the program should look, please help me!:S example 1 …

Member Avatar for WaltP
0
129
Member Avatar for CPPRULZ

I am doing an online course and for one of the chapters (in [U]Practical C++ Programming[/U] by Steve Oualline) it had a bitmapped graphics section-only 4 pages long. The chapter is about bit operations and includes a section about hexadecimals. I understoodit until I got to this passage in bitmapped …

Member Avatar for ddanbe
0
217
Member Avatar for CPPRULZ

I tried to make a simple function that takes an array parameter and outputs it and it keeps giving me th error: \function test.cpp(12) : error C2664: 'func' : cannot convert parameter 1 from 'int' to 'int []' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast …

Member Avatar for vidit_X
0
223