49,756 Topics

Member Avatar for
Member Avatar for ric24

I want to set a value to a textbox from another class. I have tried to give the GUI as parameter to a function but I can reach it in a .h file, but not in my a .cpp file. Can somebody tell me how it is possible to set …

Member Avatar for Ancient Dragon
0
145
Member Avatar for new_developer

Hi there, I want to know about wchar_t data type i.e. how it is used and why we use it. And also what is the difference between char and wchar_t. One last thing why we write L before wchar_t initialization. #include <iostream.h> void main() { wchar_t w; w = L'A'; …

Member Avatar for deceptikon
0
155
Member Avatar for waqas.zafar.125

Hi there! I have a problem in dealing with dynamic arrays. I have initialized the objects and now i want to print them. My main function looks like this: char* namesList[] = {"Brad Shaw","Aimen Adams","Sal Dimitry","Cristi Anreaz","Poala James"}; int idList[]={232,444,135,52,134}; Team t; Team t1( namesList,idList,5,"waqas"); //t1.Print_team(); My class Team looks …

Member Avatar for David W
0
203
Member Avatar for BobFX

Hi, I'm using a C++/CLI form, with a printDialog item: { public: Form1(void) { InitializeComponent(); this->printDialog1 = (gcnew System::Windows::Forms::PrintDialog()); I call the dialog with: printFont = gcnew System::Drawing::Font( "Courier New",10 ); PrintDocument^ pd = gcnew PrintDocument; pd->PrintPage += gcnew PrintPageEventHandler( this, &Form1::PrintInstPrintPage); printDialog1->ShowHelp = false; printDialog1->Document = pd; System::Windows::Forms::DialogResult result …

0
95
Member Avatar for Labdabeta

I have a program using old data for a game I play to indicate which pixels correspond to the health bar in my game. (my program just loops until a button is clicked and presses a key if the health bar drops too low). Unfortunately the health bar has moved …

Member Avatar for triumphost
0
776
Member Avatar for daniel.mukolwe

write a loop which sums all values between 10 and 100 into a variable called total. assume that total has not been initiated to zero.

Member Avatar for mike_2000_17
-1
56
Member Avatar for nitin1

actually, I was reading C++ from some time , but here i want to learn and imprve my OOPS concepts. IF you have some good links or some e-books or some good book name , please help me here. i have learnt from wiki, my one C book in which …

Member Avatar for soutrik
0
240
Member Avatar for Lp_baez

Hi I learning c++ through a book but I have found that one of the examples provided by the book is an infinite loop. So I was wonderring if anyoone can help me stop it. I tried using the 'break;' statement in every 'for' body to stop the loop but …

Member Avatar for Lp_baez
0
1K
Member Avatar for trishtren

Hello, Iv been trying to compile a simple opengl / wxwidgets program in c++ on linux mint. However when i try to compile with : g++ MyGLCanvas.cpp MyGLCanvas.h openGLProjectApp.cpp openGLProjectApp.h openGLProjectFrm.cpp openGLProjectFrm.h `wx-config --cxxflags --libs --gl-libs -lGL` -o simpleprogram I get an error message : cannot find -lwx_gtk2u_-lGL-2.8 collect2: error: …

Member Avatar for trishtren
0
134
Member Avatar for ??!!

1- Write a program that asks the user to input a number of seconds and displays the corresponding time in the form: hours:minutes:seconds. The total number of hours should not exceed 23. Example: if the input is 7275, the output will be: 2:1:15 Hint: if t is the time in …

Member Avatar for tinstaafl
-1
343
Member Avatar for Tony.Z

My code only outputs 0.00 when 'y' is entered. Clearly, I'm a beginner. #include <iostream> #include <iomanip> #include <string> const double ADULTFEE = 18.00, CHILDFEE = 7.50, TRAINFEE = 6.00, BIRDFEE = 5.00; using namespace std; int main () { char reply = ' '; double adultNum = 0, childNum …

Member Avatar for RonalBertogi
0
408
Member Avatar for rofln

Hello. I am currently working on a huffman code program for my class. As of right now, I am currently in the development/debugging stage. I've got the whole thing pretty much covered, but I am having trouble with my tree traversal. I am trying to do an inorder traversal but …

Member Avatar for rofln
0
195
Member Avatar for ms1655516

I would like to end the process. In Task Manager, but it is not the end. So I want a different way. This process changes the port randomly. PID is also random. How to exit from this situation? I need a source to bat. Process Search> PID Search> PID using …

Member Avatar for ms1655516
1
268
Member Avatar for hardus

Hi, I have a little project to do relating picture boxes in visual c++. I have googled for very long and cant find a solution. I have a picture box with 3 buttons, previous, play pause and next. It involves a timer control which will run and enable the slideshow. …

Member Avatar for tinstaafl
0
723
Member Avatar for annitaz

#ifndef LOTTO_H #define LOTTO_H #include <QWidget> #include <QLabel> #include <QTextEdit> #include <QPushButton> #include <QGridLayout> class lotto : public QWidget { Q_OBJECT private: //widget data members QLabel* numbersLabel; QTextEdit* numEdit; QPushButton* lotusButton; public slots: int generateLotteryNumbers (); void displayNumbers(); public: lotto(); }; #endif // LOTTO_H #include "lotto.h" #include <stdlib.h> #include <time.h> …

Member Avatar for plenty.groover
0
282
Member Avatar for eldiablo1121

hello, I just had a quick question on my program. I'm trying to perform an elevator class program to simulate an elevator that has 3 stops. The only problem is that I can't figure out how my floors increase or decrease, it just increases by one. Here is my code: …

Member Avatar for eldiablo1121
0
221
Member Avatar for waqas.zafar.125

Hi there! I have to read data from a file and load it into an array: here is the data of the text file: Team Creative 6 100 Anwar Khan 201 Belal Ahmed 150 Sara Amjad 400 Nida Khawar 342 Rehan Sheikh 341 Nadia Kanwal My code is: class Player …

Member Avatar for Unimportant
0
189
Member Avatar for Adnan671

Hello. I'm going through LazyFoo.net's SDL tutorials and right off the bat I got stuck. I am using Visual Basic and it is giving me an error saying that the identifier 'args[]' in the main function (line 5) is undefined. Anyone have a solution? //Headers #include "SDL.h" #include <string> int …

Member Avatar for phorce
0
492
Member Avatar for erinkay528

For some reason the program is not reading the if and else statements. Please help The assignment: Assignment: The city zoo charges the fees shown in the table below. General Admission Price Adult $18.00 Child (age 5 to 13) (Under 5 years of age: free) $7.50 Extra Events Train ride …

Member Avatar for Moschops
0
1K
Member Avatar for andrew12s

Please help me to translate this code from c to c++ #include <stdio.h> #include <conio.h> void main() { int n,i,j,a[20][20],ok=1,grade=0,aux=0;ok=1; FILE *f=fopen("c:\graph.txt","r"); fscanf(f,"%d",&n); for(i=1;i<=n;i++) for(j=1;j<=n;j++) fscanf(f,"%d",&a[i][j]); fclose(f); for(i=1;i<=n;i++) if(a[1][i]==1) grade++; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) if(a[i][j]==1) aux++; if(aux!=grade) ok=0; aux=0; } if(ok==0) printf("graph is not regular."); else printf("graph is regular."); getch(); clrscr(); …

Member Avatar for rubberman
0
285
Member Avatar for strRusty_gal

int index = 3; map<int, Class> list; std::map<int, Class>::iterator test = list.begin(); std::advance(test, index); for(map<int, Class>::iterator it = test; it != list.end();++it) { cout << it->first << " " << it->second.GetPrice() << endl; } Hi Everyone, Please help me on this issue. I know how to start at a certain …

Member Avatar for vijayan121
0
205
Member Avatar for avarionist

I spent about an hour or so googling but no luck. I want to program for hardware(which apparently people seem to think is obsolete for some reason) however i can find no tutorials on it period i suppose i could always use Assembly but my knowledge isn't that great. Is …

Member Avatar for DeanMSands3
0
3K
Member Avatar for DavidB

Here is a small--complete--program that includes a sub-routine that inputs two matrices and then multiplies them. Notes: * 1) I happen to like taking input from a text file. It eliminates the need to type input from the console, especially when debugging, it prevents the possibility of making typos. * …

Member Avatar for Shellback3
3
2K
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
145
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
237
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

The End.