49,761 Topics

Member Avatar for
Member Avatar for Lp_baez

I'm trying to create a loop if the string wordEasy contains more than 5 letters. I am using the 'while' and 'for' but none seem to work. I am hopping if you guys would be kind enough to help me figure out what I'm doing wrong. Here is the 'for' …

Member Avatar for David W
0
381
Member Avatar for Lp_baez

Hi everybody, I’m having trouble trying to figure out how to create a loop when the ‘difficulty’ takes a value that is not an integer. I want a player to get the ‘default’ statement presented in the switch . The ‘default’ statement seems to make an appearance but it will …

Member Avatar for David W
0
2K
Member Avatar for pars99
Member Avatar for rubberman
0
249
Member Avatar for sahithi.visvanathan

include a member function named rangeSearch. The function should search the list for a specified range values, defined by two numbers. All value found to be within the range shall be returned a pointer to a list of Nodes in search range. If no value is found, the function should …

Member Avatar for Unimportant
0
206
Member Avatar for Suzie999

A short while ago I was intrigued by a reply made by nullptr in [this thread](http://www.daniweb.com/software-development/cpp/threads/458583/shellexecuteex-api). So I began to look for ways to access the rest of IE (IWebBrowser2) interface, and met limited and varied success. Accessing for instance a <div></div> element in a wep page html document was …

Member Avatar for Suzie999
0
267
Member Avatar for nchy13

Following is the code snippet to override exception::what() function, but what I couldn't figure out how removing const-ness of the function produces following null terminated character string "std::exception". What I could think of is that since exception::what() is const its overriding should also be const. But, even if it is …

Member Avatar for mike_2000_17
0
191
Member Avatar for nchy13

This is a program to reverse the string in place. I have used pass by pointer. Interestingly I have changed the pointer in reverse function which is notable by seeing its output but the pointer which was passed in main function still points to the start of string. This is …

Member Avatar for deceptikon
0
164
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
156
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
208
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
786
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
241
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
135
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
345
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
196
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
724
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
283
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
496
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
286
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

The End.