49,761 Topics
| |
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 … | |
C++ code for uniform cost search algorithm | |
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 … | |
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 … | |
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? | |
how can i get the font of a control? for i change what i need and then select it | |
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 … | |
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 … | |
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 … | |
#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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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. | |
# 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 … | |
#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) … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; } … | |
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.. | |
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 … | |
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 … | |
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); … | |
[Click Here](http://postimg.org/image/53202vfs5/) | |
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 … |
The End.