49,761 Topics

Member Avatar for
Member Avatar for andrew12s

I am a beginner with programming and I really need to resolve this problem. So, I need to implement the following class that represents this type of crowd and operations with those : class Crowd { int* element; int number; public: Crowd(int m_number, int* m_element); Crowd(Crowd&); ~Crowd(); Crowd& operator= (Crowd& …

Member Avatar for rubberman
0
146
Member Avatar for arunkishorres

i want to read text between two indices in the file usinf file i/o operations in c++. HOw ca i do it? for example, here is the text file: 1: .. .. 2: .. .. 3: .. .. 4: in this text file i need to print only the lines …

Member Avatar for deceptikon
0
238
Member Avatar for frankleslie8311

//Author: Frank R. Mendez //Title: Insertion Sort //Description: Accepts int elements and stores it in an array list then sort every element in accending order //Date: 7/13/13 5:53 PM #include <iostream> using namespace std; class Sort { public: void insertionSort(int x[],int lenght); void driver(); void display(); int arr[15]; // because …

Member Avatar for kvahanyan
0
2K
Member Avatar for Suzie999

I'm trying to embed a window into my own. I somehow new it would not be as simple as it sounded, so I'd like a pointer where else to look if anyone can help. hMyOwnWindow //HWND hExternalWindow // HWND //size the external window so it will fit. MoveWindow(hExternalWindow,19,102,383,400,true); //set style …

Member Avatar for Suzie999
0
3K
Member Avatar for soche123

I don't get what this error mean in line 17 or 18.. #include <iostream> #include <conio.h> using namespace std; int main() { int players; int years=3; cout<<"Enter no. of players"; cin>>players; int record[players][years]; for(int i=0; i<=players; i++) { for(int j=0; j<=years; j++) cout<<"Enter runs scored by player"<<":"<<i+1<<": "; cin>>record[i][j]; } …

Member Avatar for rubberman
0
1K
Member Avatar for Matthew_2

I have posted this on GBA temp ([here](http://gbatemp.net/threads/garbage-on-top-of-screen-when-displaying-text-over-background.350999/)) without any replies: Another newb question.. I am currently using the 16-bit libnds example (Located within [here](http://sourceforge.net/projects/devkitpro/files/examples/nds/)) as a basis and am trying to display text and the png background image on the same screen (in this example it is the top …

Member Avatar for Matthew_2
0
183
Member Avatar for laurel.jackson.12

This first code is to go to form5 private: System::Void btnSend_Click(System::Object^ sender, System::EventArgs^ e) { MessageBox::Show("Updated task was sent to project manager."); Form5^ f5 = gcnew Form5(); f5->ShowDialog(); } But I thought it would be the same thing of I want to get back to form4 while I'm on form5 …

Member Avatar for Ancient Dragon
0
144
Member Avatar for laurel.jackson.12

#include <iostream> using namespace std; int main () { //declaring variables double Pi= 3.1416 ; double Diameter_ofcircle = 0.0; double priceofrailingmaterial = 0.0; double Totalpriceofrailingmaterial = 0.0; //Getting the user input cout<<"Enter the diameter of the circle "; cin>>Diameter_ofcircle ; cout<<"Enter the price of railing material per foot "; cin>> …

Member Avatar for laurel.jackson.12
0
300
Member Avatar for overwraith

I just glued together two codes I found online, and found an interesting result. Some of my flash drives have been appearing twice on the system. Here is what the output looks like: Drive: C:\ Volume Name: Drive: D:\ Volume Name: Drive: E:\ Volume Name: Drive: F:\ Volume Name: Drive: …

Member Avatar for overwraith
0
216
Member Avatar for Subhadeep_1

I **want to draw a magnifying glass using <graphics.h> ** in Turbo C++ (a DOS-based compiler for C++), which is mostly user as "Search" icon. But, I am having problems in making the rectangle attached to the two circles (one inscribed on another). I've also included the screenshot (made in …

Member Avatar for Subhadeep_1
0
495
Member Avatar for overwraith

Hello, I was doing some research on enumerating the different drives on a system, and I found some code on MSDN. Here is the page: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364975%28v=vs.85%29.aspx The source code looks like this: DWORD dwSize = MAX_PATH; char szLogicalDrives[MAX_PATH] = {0}; DWORD dwResult = GetLogicalDriveStrings(dwSize,szLogicalDrives); if (dwResult > 0 && dwResult …

Member Avatar for overwraith
0
264
Member Avatar for overflowh

Hi there! I'm having a little (really not so little) issue using iterators. // object t1 created here. std::vector<std::string> *f1_t1 = t1.func1(); std::vector<std::string>::iterator iterv; for (iterv = f1_t1->begin(); iterv != f1_t1->end(); ++iterv) std::cout << *iterv << " "; std::cout << std::endl; std::vector<std::string> *f2_t1 = t1.func2(); for (iterv = f2_t1->begin(); iterv …

Member Avatar for mike_2000_17
0
403
Member Avatar for FC Jamison

How would I write a C++ class of which only one can be created ever be instantiated in any program. I know that ClassName* objectName = new ClassName(); instantiates an object, but how would I make it so when you try to instantiate it more than once you still end …

Member Avatar for rubberman
1
6K
Member Avatar for mara.pradia
Member Avatar for ??!!

hey guys i just need someone to help me out in parts (c) and (d) of the following question: a- Implement the function f(a,x)=sin(ax)/x. (the prototype is double f1(double a, double x). Note that this function is equal to a for x=0. (6 points) b- Write a code that asks …

Member Avatar for shvmgyl15
-1
163
Member Avatar for Lp_baez

I am currently learnning c++ from a text book. but I have come accross an error when trying to run the program. The error reads like this: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source code? …

Member Avatar for Lp_baez
0
377
Member Avatar for TheTimeCat

Hi everyone - I hope your day is going great. Can someone please kindly help me with the coding of the following function - I have absolutely no clue where to start - Given the following sets of numbers - 1154 1179 2154 2554 2484 2144 4515 1144 1517 4815 …

Member Avatar for TheTimeCat
0
162
Member Avatar for johans22

#include <iostream> typedef struct _elems { int a; int b; int c; }elems; static elems eArray1[]={{5,9,13}, {12,22,1}, {2,3,4},{4,3,1}}; static elems eArray2[]={{23,121,55}, {88,23,90}}; eArray1 and eArray2 can have different sizes such as 1x3, 2x3, 4x3, 5x3, etc.How to combine these ,eArray1 and eArray2, into a structure called eArray and loop and …

Member Avatar for Ancient Dragon
0
145
Member Avatar for laurel.jackson.12

#pragma once namespace Hardware_Store { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Summary for Form1 /// </summary> public ref class Form1 : public System::Windows::Forms::Form { //array variables private: array<String^>^itemNoA; private: array<String^>^descriptionA; private: array<int^>^noStockA; private: array<double^>^priceA; public: …

Member Avatar for gusano79
0
284
Member Avatar for kvahanyan

Hello people, I want create and use a simple library but this is the first time, so I need help. 1. If I have cpp file with it's header, how do I create a shared library with g++. 2. After I created the .so library, how do I include it …

Member Avatar for vijayan121
0
232
Member Avatar for waqas.zafar.125

Hi there! I have a question related to filing in c++. I have to read data from a text file and load it into 2-d dynamic array. Here is the problem statement: 5 3 3 8 1 4 2 5 7 2 4 6 8 0 9 3 1 2 …

Member Avatar for Kanoisa
0
162
Member Avatar for ??!!

Hey guys i really need someone todo the following it's urgent: Declare and initialize a dynamic array of rectangles. Define an array of pointers to the array of rectangles and use it as search index by area. Define two other similar indexes to facilitate search by length and width.

Member Avatar for mike_2000_17
-1
238
Member Avatar for Labdabeta

Hello, I made an arbitrary precision integer library a few weeks ago. It works well, but is bounded by `256^(8*sizeof(size_t))` because it uses a simple dynamically allocated array to do its work. I want some way to have theoretically unbounded storage. I think that file io is probably best, but …

Member Avatar for Labdabeta
0
209
Member Avatar for Suzie999

I'm running this code. SHELLEXECUTEINFO ExecuteInfo = { 0 }; ExecuteInfo.cbSize = sizeof(ExecuteInfo); ExecuteInfo.fMask = 0; ExecuteInfo.hwnd = nullptr; ExecuteInfo.lpVerb = L"open"; ExecuteInfo.lpFile = L"C:\\progra~1\\intern~1\\iexplore.exe"; ExecuteInfo.lpParameters = L"http://www.google.co.uk"; ExecuteInfo.lpDirectory = nullptr; ExecuteInfo.nShow = SW_SHOW; ExecuteInfo.hInstApp = nullptr; ShellExecuteEx(&ExecuteInfo); Sleep(5000); CloseWindow((HWND)ExecuteInfo.hwnd); exit(GetLastError()); It's not closing the window. And it's exiting with …

Member Avatar for Suzie999
0
966
Member Avatar for laurel.jackson.12

Problem 1: When I need to display my zipcode, I get zipcode and city. Problem 2 : When I enter zipcode I get zipcode not found. This my zipcode and city 60561 Darien 60544 Hinsdale 60137 Glen Ellyn 60135 Downers Grove #include <iostream> #include <string> #include <fstream> using namespace std; …

Member Avatar for tinstaafl
0
147
Member Avatar for 2384443

plzz help me with this program #include<iostream.h> #include<conio.h> int sum(int s); int sum(int x); int sum(int j,int k); float sum(float p,int q); float sum(float y,float z); void main() { cout<<sum(0)<<"\n"; cout<<sum(3)<<"\n"; cout<<sum(6,7)<<"\n"; cout<<sum(5.5,8)<<"\n"; cout<<sum(4.9,3.5)<<"\n"; getch(); } int sum(int s) { return s; } int sum(int x) { return x; } …

Member Avatar for richieking
0
140
Member Avatar for soche123

![729809d51c75da2de9381dc33f42887d](/attachments/large/4/729809d51c75da2de9381dc33f42887d.jpg "729809d51c75da2de9381dc33f42887d") okay guys this the program in which we have to add a record,modify it or delete it. it adds and shows it successfully but whenever we want to delete a record it doesn't. When we add to records and delete the second one ,the list looks like this,

Member Avatar for tinstaafl
0
703
Member Avatar for team_ferrari22
Member Avatar for senadfok
0
182
Member Avatar for eldiablo1121

Hello everyone I have pretty lengthy code here, i think I may need to place all the code, but all I need is one one thing, it's pretty much done: #include <iostream> #include <iomanip> #include <string> #include <ctime> using namespace std; // Function prototypes void BuildDeck( int deck[], const int …

Member Avatar for eldiablo1121
0
2K
Member Avatar for J-P1988

Hey! On Qt, i created an QList<QLabel*> but when i try to access or modify it in later functions i get: Démarrage de C:\Projet QT\Text Based RPG\build-textbasedrpg-Desktop_Qt_5_1_0_MinGW_32bit-Debug\debug\textbasedrpg.exe...ASSERT failure in QList<T>::operator[]: "index out of range", file ..\..\..\Qt\Qt5.1.0\5.1.0\mingw48_32\include/QtCore/qlist.h, line 460 Invalid parameter passed to C runtime function. Invalid parameter passed to C …

Member Avatar for J-P1988
0
873

The End.