49,756 Topics
![]() | |
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 … | |
I am writing a DOS screen football game(No graphics), I have reached 61,283 lines any bigger than this I get a error that says linker warning, exceeded memory limit for block line cache in module. Old compiler version 4.0. | |
plz help me , need a code that search a word for file saved in note pad in show the out put as is this wrd exsist in file or not n if yes how many time appear.... | |
Hello everybody! I need some help in my program it is about Guess number game. the program is working but not that I have expected, when i enter guess 76 the output gives me that 76 is Too small :( instead of Too big .Even I type any number 64,99 … | |
isShorter(const string &s1, const string &s2) { return s1.size() < s2.size(); } stable_sort(ret.begin(), ret.end(), isShorter); either using stable_sort or sort the result is shown in the attachment. meanwhile: "By calling stable_sort, we can maintain alphabetical order among those elements that have the same length:" - C++ Primer 5th edi. which … | |
give an example for a C++ program that sorts list of integers. The list should have a size of power of two. Example: list size = 2, 4, 8, 16… Algorithm 1. Divide the array into two lists until a single element remains in any list While merging given two … | |
give example of a C++ program that sorts list of integers. The list should have a size of power of two. Example: list size = 2, 4, 8, 16… Algorithm 1. Divide the array into two lists until a single element remains in any list While merging given two sorted … | |
write a program in which a class has three data members: name, ID, marks of 5 subjects (int marks[5]) and a member function Assign() to assign the streams on the basis of table given below: Avg.Marks Stream 90% or more Computers 80% - 89% Electronics 75%-79% Mechanical 70%-74% Electrial In … | |
Can anyone please tell me how to use the built in graphics in c++.Is there any tutorial on this?Which graphics will be suitable for using in c++?If there is any tutorial on this,please give the link. Thanks in advance. |
The End.