49,756 Topics

Member Avatar for
Member Avatar for Abdel Fattah
Member Avatar for skip09

Hello! :) I need to create a Question & Answer Program, just like "Who wants to be a Millionaire". So far, i am partially done with the code. It's just I am having problem regarding with lifelines. I need to make the 3 lifelines be used for only once. Really …

Member Avatar for rubberman
0
237
Member Avatar for Hanan_2

hey i got this program to calculate grades by reading from a file but im getting some error. can anybody help. #include <iostream> #include <fstream> #include <string> using namespace std; int highestGrade (int score1, int score2, int score3);// prototype for first function char letterGrade (int highscore);// prototype second function int …

Member Avatar for Slavi
0
364
Member Avatar for caffeine

Hi all, I would like to return an array of String variables from a C++ DLL to a VBA application. My understanding is that: [LIST=1] [*]To do so, the C++ function must return a SAFEARRAY of BSTR. [*]Although Excel uses BSTR containing wide characters (wchar_t), VBA itself uses BSTR with …

Member Avatar for Michael_33
0
2K
Member Avatar for rvndrdahiya

I declared two different char * and initialised them to the same string. but i thought they would be pointing to the different addresses , but they pointed to the same addresses.. How come this happens? char* arr = "abcdefgh"; char* brr = "abcdefgh"; cout<<arr<<endl; cout<<brr<<endl; the values printed out …

Member Avatar for rvndrdahiya
0
280
Member Avatar for VengefulToast

Hello, I have some questions I thought of searching the web and I would be eternally grateful for anyone to answer some of them. How to properly override the ostream operator? What exactly is big O notation? How to count primitive operations? Is there a way to see how much …

Member Avatar for deceptikon
0
321
Member Avatar for obinaysamanoden

Average #include <iostream> #include <cstdlib> using namespace std; bool check(double element[], int count); int main() char redo; do { system ("cls"); double elements = 0, i = 0, j = 0, average_elements = 0; int k[1]; bool correct; cout<< "This program will show the average element of a sequence.\n\n"; cout<< …

Member Avatar for bernardo.mclobo
0
171
Member Avatar for Dondrell

#include <iostream> using namespace std; // Constant for the number of months const int NUM_MONTHS = 12; // Declaration of the WeatherInfo structure struct WeatherInfo { double rain; // Total rainfall double high; // High temperature double low; // Low temperature double averageTemp; // Average temperature }; int main() { …

Member Avatar for ddanbe
-1
268
Member Avatar for Shamar_1

Write, compile, and execute a C++ program to calculate the sum of the numbers from 1 to 100. The formula for calculating this sum is sum = (n/2)(2*a + (n-1)d), where n = number of terms to be added, a = the first number, and d= the difference between each …

Member Avatar for ddanbe
-1
337
Member Avatar for Shamar_1

Write a C++ program that generates a 7 character randomized password from the set integers 1 – 9 and A-Z.

Member Avatar for ddanbe
-1
234
Member Avatar for obinaysamanoden
Member Avatar for malikbasit
Member Avatar for bernardo.mclobo
-2
85
Member Avatar for Miguel_4

1. Total Purchase A customer in a store is purchasing five items. The prices of the five items are: Price of item 1 = $ 12.95 Price of item 2 = $ 24.95 Price of item 3 = $ 6.95 Price of item 4 = $ 14.95 Price of item …

Member Avatar for bernardo.mclobo
-1
143
Member Avatar for LATCH808

so this is a checkout program. Hers my problem: the user enters 1 to enter checkout and then enters the PLU code followed by the weight of it or unit, then they have to choice to enter another PLU code or 0 to exit. Once the user enters 0 it …

Member Avatar for bernardo.mclobo
0
138
Member Avatar for cambalinho

how send a message with WM_DRAWITEM message? heres my actual code on parent window: case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; /*if(test->CtlType==ODT_MENU) { MENUITEMINFO menuInfo; menuInfo.cbSize = sizeof(MENUITEMINFO); menuInfo.fMask=MIIM_DATA; if(GetMenuItemInfo((HMENU)test->hwndItem,(UINT) test->itemID, TRUE, &menuInfo )!=0) { Menu *mMenu = (Menu *) menuInfo.dwItemData; if(mMenu!=NULL) if(mMenu->DrawItem!=NULL) //mMenu->DrawItem(); else { } } } else { …

Member Avatar for cambalinho
0
380
Member Avatar for pdk123

Hello, I have a basic c++ STL question. I have an octet array class (legacy). Now lets say the octet array has the following contents: array[0]=00 array[1]=01 array[2]=30 array[3]=01 array[4]=114 The key we need to generate from the above array should match ["00130-1-114"] Whats the best way to get this …

Member Avatar for L7Sqr
0
254
Member Avatar for Jazmine_1

Hey everyone! Thanks for all the help before and now I have another problem. So I'm doing a clock program with three "invalid" attached files. There are zero errors but still won't run the program, any advice out there?

Member Avatar for Jazmine_1
0
306
Member Avatar for sherry ibrahim

write a program select an operation 1)innerproduct 2)matrix*vector 3)vector*matrix 4)matrix*matrix 5)transpose 6)exit how i wrote this with switch and for loop

Member Avatar for deceptikon
0
56
Member Avatar for obinaysamanoden

Average #include <iostream> #include <cstdlib> using namespace std; bool check(double element[], int count); int main() Average #include <iostream> #include <cstdlib> using namespace std; bool check(double element[], int count); int main() { char redo; do { system ("cls"); double elements = 0, i = 0, j = 0, average_elements = 0; …

Member Avatar for David W
0
270
Member Avatar for Neon_1

Hi, I am very new to CMake. In fact, I am trying this tutorial http://www.cmake.org/cmake-tutorial/. I do not understand some of the words prescribe there but I can manage. The problem I have with tutorials is the inclusion of TutorialConfig.h. I check the tutorial files and such file doesn't exist. …

Member Avatar for mike_2000_17
0
1K
Member Avatar for LATCH808

can someone tell me whats wrong with it or what i should do? #include <iostream> #include <iostream> #include <string> #include <fstream> #include <vector> using namespace std; List storage[50]; int e = 50; int intro(void) { int userChoice; cout << "Enter 1 to checkout or 0 to end checkout."; cin >> …

Member Avatar for bernardo.mclobo
0
430
Member Avatar for Fenrir370

So im doing an assignment for class and im not sure what/how to proceed, im struggling with storing randomly generated numbers in an array and then calling on them later to display how many times the random number has been called them. as you might notice i already have my …

Member Avatar for Fenrir370
0
252
Member Avatar for bythescruff

Hi folks. I'm about to evaluate an implementation of SYCL for ease of use and performance when writing parallel programs for heterogeneous environments, and I'm looking for good candidate programs to port to SYCL which will exercise its C++ features. Can anyone suggest any good examples of open source libraries …

Member Avatar for mike_2000_17
0
250
Member Avatar for Shamar_1

Write a C++ program that accepts four quizzes (30%), two midterms (40%) and a final (30%) and displays the overall average. The maximum score for all quizzes and exams is 100 points.

Member Avatar for rubberman
-1
247
Member Avatar for Shamar_1

Write, compile, and execute a C++ program to calculate the sum of the numbers from 1 to 100. The formula for calculating this sum is sum = (n/2)(2*a + (n-1)d), where n = number of terms to be added, a = the first number, and d= the difference between each …

Member Avatar for David W
-2
168
Member Avatar for cambalinho

think in these way: the eyes have the blue color, the backcolor is blue. so how can i change the backcolor without change the image\eye? (these is just an exemple for trying explain)

Member Avatar for cambalinho
0
149
Member Avatar for cambalinho

heres my image class: class image { private: ULONG_PTR m_gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; HDC hdcimage=CreateCompatibleDC(NULL); HGDIOBJ obj=NULL; HBITMAP btBitmap=NULL; Image *img; bool isimgused=false; int imageheight=0; int imageweight=0; int framecount=0; int intSelectFrame=0; int framedelay=0; string strfilename=""; Gdiplus::Color clrBackColor=Gdiplus::Color::Transparent; HDC hdcwindow; bool blnTransparent=true; HICON HICONFromHBITMAP(HBITMAP bitmap) { BITMAP bmp; GetObject(bitmap, sizeof(BITMAP), &bmp); HBITMAP …

Member Avatar for Schol-R-LEA
0
296
Member Avatar for iikitty

The first few digits are always "0"s and the last is "1"... I tried calculated on paper many times according to the steps in the code which I believe its logical and smooth. However it outputs "0"digits in front and "1" at last for every execution and I dun know …

Member Avatar for iikitty
0
310
Member Avatar for David_53

can anyone please explain different with vector::begin() and std::begin() ?? the code is based on the book, Effective Modern C++ item13. #include <iterator> #include <boost/type_index.hpp> using namespace boost::typeindex; #define PRINT_TYPENAME(__param) do { \ std::cout << "param (" << #__param << ") " \ << type_id_with_cvr<decltype(__param)>().pretty_name() \ << std::endl; \ } …

Member Avatar for vijayan121
0
349
Member Avatar for NoobCoder85

Here is my code: ` #include <iostream> #include <iomanip> #include <string> using namespace std; class Register { //Private members private: //Creating an array for all the Prices static double Price[]; //Declaring RegNUM and RecNUM int RegNUM, RecNUM; //Print out Item name in a loop static string items[]; //Creates a Receipt …

Member Avatar for David W
0
369

The End.