49,757 Topics

Member Avatar for
Member Avatar for Neon87

Hi I have a question regarding runtime polymorphism. I have for example [CODE]derived A; base *B;[/CODE] and I do this [CODE]B=&A;[/CODE] if A goes out of scope does this mean the pointer B is a bad pointer meaning it does not point to anywhere? If so, does this mean I …

Member Avatar for Narue
0
97
Member Avatar for winecoding

How many constructor (including copy constructor) and destructors will be called for test1 and test2? [CODE]#include <iostream> using namespace std; class Base{ public: Base(){cout << "Base()" << endl;} Base(const Base&){cout << "Base(const Base&)" << endl;} ~Base(){cout << "~Base()" << endl;} }; Base func(Base b){return b;} void test(){ Base a; func(a); …

Member Avatar for Lawand
0
83
Member Avatar for Stefano Mtangoo

I'm curious what you Developer uses: 1. What is your favorite IDE 2. What is your favorite GUI library 3. What is library that you often use? 4. Anything related?

Member Avatar for Lawand
0
136
Member Avatar for BigTito89

Hi, I'm having a problem wrapping my head around a problem. Here is the problem: Develop a program that will input a binary string and then, using bitwise operations, do a two's complement on the string and display it. Use UNSIGNED data types for the bit strings. So far, I …

Member Avatar for r.stiltskin
1
953
Member Avatar for vinochick

I need to write a program that uses P = (nRT)/V P = pressure V = volume n = number of moles R= universal gas constant (8.31 j/mol K) T = absolute temperatre All variables must be local, no global variables. Inputs to the program include kelving temp, initial and …

0
58
Member Avatar for edgar5

I am a developer on the open source Audacity team and am trying to add some functionality. Currently if you drag the icon of a supported type (fi song.wav) onto an open Audacity project it loads the file. However if you drag song.lnk (like an XP shortcut but different--looks like …

Member Avatar for mitrmkar
0
217
Member Avatar for jp071

Hello, Referenced memory error in visual c++ .exe file. When i was run my program's .exe file (program written by visual c++ 2008 win32 windows application), it could work fine. but problem is when i click a button for executing something and display on the window screen (otherwise it works …

Member Avatar for donaldw
0
120
Member Avatar for V5dave

Am new to C++ and don't know if I'm doing something fundementally wrong. Have a form with a textbox and buttons. When I click on button, I am running a function in my .cpp file. However, in this function I need to update the text box in the form. Have …

Member Avatar for gpushee
0
582
Member Avatar for walter clark

What I want to do must be easy because I can't find it on the web. I have existing C code with char* strings all over the place. I'd like to get those strings to the Form1.h file so I can use them there. All I want is... String^ newText; …

Member Avatar for walter clark
0
97
Member Avatar for pilu

Hello, I'm quite new to c#. I have one C++ dll in which I have the two simple add & delete functions. [code]int MyTestFuncs::Add(int a, int b) { return a + b; }[/code] I have to access them into the C# code. I have faced the following error - When …

Member Avatar for DdoubleD
0
284
Member Avatar for earlati2

I used this simple code to test an memory leak reported by valgrind. [CODE=cpp] /****************************************** * FILE: t3.c * Compiled using : g++ -g t3.c -o t3 * * $ g++ -v * Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/specs * Configured with: ./configure --prefix=/usr --infodir=/share/info --mandir=/share/man * --enable-languages=c,c++ --with-system-zlib --program-suffix=-3.4 --enable-threads=posix * …

0
66
Member Avatar for ueoptimum

Sorry for disturb you all, but a I'm newbie..because my teacher give a assignment.. this my assignment.. [B] Machine Problem[/B] 1. Make a C program that will display "I will pass PRGLF" on the center of the screen. 2. Design a program in C language that will display "#" at …

Member Avatar for zalezog
-1
126
Member Avatar for DJZ

My teacher gave use a project were we have to read a text from a file and then output some results. I have got C++ to read the text from file but I have to average out each persons test scores and then output them. I am not sure how …

Member Avatar for Ancient Dragon
0
93
Member Avatar for foxmulder

Hi! For my last assignment I was told do create a program which can read-, sort- sand save a textfile (.txt). For example, I have a textfile containing 5 movies, this file is going to be read by the program and then sorted (in alphabetical order) and then saved to …

Member Avatar for Ancient Dragon
0
194
Member Avatar for forstudy3

I have written a function which will open the file with the input name provided.I am compiling on a Linux box using g++ compiler.Detail code below Plz let me know what is the wrong in code. [CODE]1 #include<iostream> 2 #include<fstream> 3 #include<string> 4 #include<stddef.h> 5 #include<cstddef> 6 #include<cstring> 7 8 …

Member Avatar for Clinton Portis
0
290
Member Avatar for sidra 100
Member Avatar for sidra 100
-5
71
Member Avatar for BSKI01

I know there are many things like this on this site already but my teacher is smart and will search to find out if we just copied from an internet interveiw Hello My name is Ben and I am a sophomore at high school in New York. I am currently …

Member Avatar for ithelp
0
97
Member Avatar for miag

[COLOR="Green"]i'm so confused with this program. should anyone give me some clues how to begin?[/COLOR] Define a class called StringSet that will be used to store a set of STL strings. Use an array to store strings. Create a constructor that takes as an input parameter an array of strings …

Member Avatar for jonsca
0
111
Member Avatar for FancyShoes

I want it so that when a user doesn't enter char r,p,g,m,c,y it will come up and say incorrect input enter 4 correct values. This is what I have. [CODE]while( (g.one || g.two || g.three || g.four) != ('r' || 'p' || 'g' || 'm' || 'c' || 'y') );[/CODE] …

Member Avatar for FancyShoes
0
130
Member Avatar for nychick

Hey everyone, I'm trying to implement a operator overload of several operators. I want to make sure my syntax is correct. Here's my old Class implementation: [CODE]#include <iostream> using namespace std; class Date { private: int mn; //month component of a date int dy; //day component of a date int …

Member Avatar for jonsca
0
88
Member Avatar for mymyzzz

I need to finish this program, but i have no idea how to! please help me figure this out. [code] #include <iostream> #include <fstream> using namespace std; void printShips(char [15][15]); void fire(int row, int col, char ocean[15][15], char &result, char &ship); struct counter { int B, C, D, F, T, …

Member Avatar for Clinton Portis
0
400
Member Avatar for eduard77

Can anyone tell me what is wrong with this code? I found it on Wikipedia When I compile it it gives me a lot of errors [code] void parallel(int num_threads,int matrix_demention) int i; for(i=0;i<num_threads;i++) create_thread(&threads[i],i); pthread_attr_destroy(&attr); // Free attribute and wait for the other threads for(i=0;i<p;i++) pthread_join(threads[i],NULL); void *gauss(int thread_id) …

Member Avatar for Clinton Portis
0
139
Member Avatar for amel036yippee

Hello! I'm a newbie here... Straight to the point, I tried to create a program as stated in the title above musing C++. Below are the code I used: [CODE]#include <iostream> #include <cstdlib> const board=8; const pop=20; using std::cout; using std::endl; double table[board][board]; int r; int c; int main() { …

Member Avatar for amel036yippee
0
98
Member Avatar for Stefano Mtangoo

I see alot of libraries written in C and I like C++ OOP way. How can I use a given C library functions in C++?

Member Avatar for Stefano Mtangoo
0
174
Member Avatar for uberian22

i am getting errors when i compile this program [CODE]#include <iostream> #include <cctype> using namespace std; const int MAX_DIGITS = 20; int size; // number of digits in the integer int digit[MAX_DIGITS]; // the digits stored in reverse order void inputBigInt (int a[], int& sizeA); / void outputBigInt(int a[], int …

Member Avatar for uberian22
0
76
Member Avatar for 07tr0wa07

Hi guys i'm new in C++..:icon_wink: I have a homework that i need to pass soon and i need help because i only have 1 error and i'm staring at it for 2 hours:icon_cry: going back and forth to my book and came up with no solution:icon_sad:. ok so heres …

Member Avatar for Lerner
0
262
Member Avatar for Stefano Mtangoo

Some C++ buzzwords a programmer need to grasp really boggles my mind. I try to understand them but I strangely, get dim understanding of them (am I tired? Need a vacation?). Anyway please help me understand the following big words in C++ 1. Virtual Functions 2. Polymorphism Thanks alot

Member Avatar for Stefano Mtangoo
0
646
Member Avatar for richman0829

I think the pieces, taken separately, are okay, but they don't seem to play together well. [CODE] //lab12: This program requests input of ten employee names and salaries; //a file is created and they are written into it, and the file is closed. //The file is then reopened and the …

Member Avatar for Lerner
0
105
Member Avatar for DevC++4.9.9.2

hey im trying to do a quick mod function, i know % exists but this will have other applications... Basically the main issues is when you return "num" it is a different value than if you look at num before it is returned... Any ideas? thanks in advance [code] int …

Member Avatar for r.stiltskin
0
121
Member Avatar for BigTito89

Hello, for my final team project for C++ we are making a simple space invaders clone with the [URL="http://www.libsdl.org/"]SDL[/URL] libraries. Most of it is working great so far but in order to 'destroy' the enemies, they must not be drawn anymore and should be destructed. ER is just the # …

Member Avatar for BigTito89
0
159

The End.