49,761 Topics

Member Avatar for
Member Avatar for Seba Sama

Hello, I'm trying to understand some things about derived classes: how to add something "extra" to existing functions in base class. My base class is "shape2D" like a rectangle, 3 functions: set values, calculate, show results. No problem here. Then I create a derived class named "shape3D". Please note the …

Member Avatar for Tumlee
0
350
Member Avatar for SurafielHabib
Member Avatar for andreas.petrou.967

Write a program to read an unknown number of integer numbers stored in a file nums.txt and calculate the number of negative, the number of positive numbers and the number of zeros. Your application should display on the screen the number of negative and positive numbers as well as the …

Member Avatar for andreas.petrou.967
0
123
Member Avatar for Nimerion

Hello guys, Happy New Year! I want to ask some questions, that I didn't find enough information about, so I thought that the people from DaniWeb can help me figure it out better. So here is the problem.. I want to make a 2D physics and math, just to practice …

0
81
Member Avatar for cambalinho

from VB6, i build these code for transparent: void Transparent() { SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); SetLayeredWindowAttributes (hwnd, clrBackColor, 0, LWA_COLORKEY); const char *text; text=to_string( GetLastError()).c_str(); MessageBox(NULL,text,"erro",MB_OK); } but i get 1 error from messagebox: 87:ERROR_INVALID_PARAMETER - The parameter is incorrect. can anyone advice me?

Member Avatar for cambalinho
0
185
Member Avatar for cambalinho

how can i get the font of a control? for i change what i need and then select it

Member Avatar for cambalinho
0
81
Member Avatar for pars99

So, I see pointers defined in many different ways but I never quite understood what the difference was. Could someone explain it to me? Examples: `int * a; int* a; int *a` That second one may or may not be actual C++ but I've seen it done in all those …

Member Avatar for pars99
0
137
Member Avatar for Builder_1

the folllowing code i have made but its not catering for the vowels coming together...what should i do in this code to accurately count the number of vowels and count the remining char left in string without vowels as after tokenization only the first token remains in the char array/string …

Member Avatar for Builder_1
0
565
Member Avatar for mixelplik

I'm practicing arrrays and in the following program I'm passing a multidimensional array to a function to fill it. This worked with a single dimensional array just fine. (1) Is this bad practice? (2) Do the multi-D arrays work the same way as the regular ones. In the program below …

Member Avatar for mixelplik
0
212
Member Avatar for pem

#include <iostream> #include <string> #include <vector> #include <algorithm> #include <fstream> #include <cstdlib> using namespace std; int main() { string title, nameX, nameY; const int maxData = 20; int data, maxValue; int count = 0; vector<int> v; maxValue = *(max_element(v.begin(), v.end())); for(int a = maxValue; a > 0; a++) { if …

Member Avatar for Moschops
0
120
Member Avatar for sireiz

Hi, I want to put urdu language text in a software to be searched. How can i do that? Software is like a lot of text and people can search through it to find specific sections or parts. And for those who don't know urdu, it is written like arabic.

Member Avatar for triumphost
0
123
Member Avatar for Fahad_3
Member Avatar for triumphost

Why is accessing data in an uninitialised array undefined behaviour? I ask because I was doing some benchmarking on `vector<int>` vs. `int*` vs. `int**`. My results were: http://stackoverflow.com/questions/20863478/class-using-stdvector-allocation-slower-than-pointer-allocation-by-a-lot Now I'm being told if I use the raw array and try to access an index without initialising it first, it is …

Member Avatar for mike_2000_17
0
191
Member Avatar for muhammadmuzzammil1998

Here is the code for GUI in C++, http://facebook.com/muhammadmuzzammil1998 Tested in Code::Blocks hope it will help you :) #include <windows.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "CodeBlocksWindowsApp"; int WINAPI WinMain …

0
281
Member Avatar for James19142

I'm new to Visual Studio & trying to build an application in it for the first time. The code compiles. I used to get the error load from the debugger as a result of not downloading the corresponding .pdb files. After changing a setting in the debugger options, all the …

Member Avatar for James19142
0
1K
Member Avatar for viovicente

Hey ahm Im newby when it comes to C++ ahm can anyone help me, 'cuz I can't find answers for some of my questions, I actually go to youtube mostly but most of the videos there is not more satifying.. hehehe.. thanks.

Member Avatar for Moschops
0
70
Member Avatar for mike_2000_17

# Introduction # The subject of this tutorial is a bit more advanced than the subjects I have tackled in the past, but I hope this will find some interested readers. From time to time in C++, programmers find themselves torn apart between using a *Generic Programming* style which primarily …

2
2K
Member Avatar for mixelplik

#include <iostream> #include <iomanip> using namespace std; int main() { cout << "\n0----------------------1------8\n"; cout << setw(22) << left << "Registration Fee "; cout << setw(8) << right << fixed << setprecision(2) << "$ " << 22.0 << endl; cout << setw(22) << left << "Hotel Total "; cout << setw(8) …

Member Avatar for mixelplik
0
203
Member Avatar for Damian_2

Okay so I have `MainShop`(base class) then `SwordShop` and `BowShop`(derived classes) and another derived class called `Inventory`. I have a vector under protected in my base class, and when I access it from my derived classes it's okay, but each one has its own value. How can I set them …

Member Avatar for Damian_2
0
238
Member Avatar for ceelos1974

Hi everyone I'm new to c++ but have had some luck so far. But I have of course met a problem. The program I'm making is supposed to find a a unkown file with an ID. The onliest thing I know of the file is the folder its in. so …

Member Avatar for Ancient Dragon
0
410
Member Avatar for cambalinho

i'm building the label1 class, but i'm getting bad results... so i ask: how can i use the SetWindowLongPtr() for use a window procedure? (i can show the label and change it's properties... but i'm getting problems for active it's own window procedure :( ) see the entire code\class: #include …

Member Avatar for cambalinho
0
838
Member Avatar for Builder_1

what are the differences of string and cstring header files and how does the pre defined function of strcmp which is called string comparison works???? i know it gives 0 if string 1 = string 2 gives +ive and -ive if str1 is greater or less but it calculates that …

Member Avatar for Builder_1
0
7K
Member Avatar for tom.scott.73113

Hi Im working on a program at the moment and seem to be having issue with this section when trying to get section 3 i get section 2 Ive pasted code below any help or suggestions would be great. Thanks if(gps=='Y'||gps=='y'&&childseat=='N'||childseat=='n') { if(stoi(daysamount)<=3) { extra=stoi(daysamount)*5; } else { extra=15; } …

Member Avatar for tom.scott.73113
0
133
Member Avatar for Raja.rahmanway

hello all.. I raja from indonesia wanna ask about gsl in c++ and can you give me some example program source about it?? because i wanna take a some examination about it :D thaks..

Member Avatar for Ancient Dragon
0
44
Member Avatar for Labdabeta

I need to know which of these three copies of code is considered best. I also need to which one is more efficient memory wise and which is more efficient time wise. Thanks: enums [CODE]enum MyEnum{EnumTypeOne=1,EnumTypeTwo=2,EnumTypeThree=4,EnumTypeFour=8};[/CODE] macros [CODE]#define EnumTypeOne 1 #define EnumTypeTwo 2 #define EnumTypeThree 4 #define EnumTypeFour 8 typedef …

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

hi friends ... this is my 1st post I'm sure it gonna be beneficial to me.. Well I'm facing problem in this assignment.As I'm not that good in c++ programming. Please help me out .We have to use doubly linked list. **Assignment requirements Overview** You are expected to write a …

Member Avatar for Moschops
0
947
Member Avatar for Alya_1

the given question is 2x+3y-z=5 x-y+z=1 3x+2y+2z=6 i'm supposed to get the values of x,y,z from this coding. #include <iostream> #include <cmath> using namespace std; void GetMat (float A[10][11], int numrow, int numcol); // to enter elements in a 2 dimension matrix void DispMat (float A[10][11], int numrow, int numcol); …

Member Avatar for Alya_1
0
290
Member Avatar for nicholas.f.fortino
Member Avatar for mike_2000_17
0
142
Member Avatar for safoin
Member Avatar for rmsh92

Write a C++ program that reads data from a data file called “temp.dat”. The data file contains a maximum of 31 daily integer temperature values for a city. Your program should continue displaying the following menu until the user selects exit (option No. 6). Head of the data Tail of …

Member Avatar for dresha
0
211

The End.