49,756 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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<< … | |
#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() { … | |
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 … | |
Write a C++ program that generates a 7 character randomized password from the set integers 1 – 9 and A-Z. | |
| |
how to make uion and intersection of two variables using arrray | |
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 … | |
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 … | |
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 { … | |
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 … | |
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? | |
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 | |
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; … | |
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. … | |
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 >> … | |
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 … | |
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 … | |
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. | |
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 … | |
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) | |
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 … | |
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 … | |
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; \ } … | |
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 … |
The End.