49,761 Topics
| |
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 … | |
I've learned the basics of c++ Now, I want to develop and enter the graphics world, Any suggestions? | |
Can someone please recommend me on a right way of working with codes? how should i plan it? how should i arrange it? every time i start a project i find myself later struggling with the difficulties of an unplanned project. how do YOU do it? | |
Good Day Sir, I am practicing on how to program something using do...while loop. I want to make a program that will ask for the Prelim, Midterm, Finals and Semestral Grade. 70% is the passing rate in our University. What are the codes that I have to put in C++? | |
Hello, for a school assignment I was supposed to write an insertion sort algorithm for a doubly linked list. As the feedback system of this particular course is rather weak (actually non-existent) I would like to ask you for your honest opinion about how well this is implemented, what could … | |
Why it keeps giving me a zero answer ?!!! even though there IS a text file to search in it !! //a C++ project that reads a text from an input file and writes the same text into an output and find how much symbols are there #include <iostream> #include … | |
Hi does anyone know if it is possible to use bruteforce to check for a username and a password in a website using C++? If yes please provide some code. Thanks! (Oh, and I am going to use that with educational purposes only) :D | |
Hi, I was assigned a project to write a user information program to help create and maintain user data. One of the parts of the project I am completely stumped on is how to validate the password a user would input... Tasks are... Evaluate Password - If either of the … | |
question related to C++ 1) Find the sum of natural numbers from 1 to 10. 2) Accept n numbers and find total of divisible by 5 and not by 10. | |
Hello, I need to write a program that calculates how many days from year January 1, 0000 to any specified date including leap years. When I run the program that I have, I am off by a few days for any given date. Can someone please check out my code … | |
The tools Hal’s sells are: Hammers: $10.99 Wrenches: $10.99 Levels: $19.99 Tape Measures: $4.99 Screwdrivers: $8.99 In order to make things easier in the long run you have decided to make a c++ program that takes in all the orders for each register and tallies them at the end of … | |
I hope it's right place for it, if no - sorry, please tell me where I should place it. I wrote simple time class, could you review it, tell me what I did good, what wrong, and how I can fix it? I excluded things like include guards, namespaces, include … | |
So I was given a stack program to convert from int to char. I converted it but the output is...not expected. Wanting someone to point me in the right direction. I will post the header and driver program of the int stack and then the header and driver of the … | |
This tutorial is the first time I write about coding techniques for improving the performance of software. This is going to be a step-by-step journey through a real example, with real benchmark results at every step so that you can see the effect of the different optimization techniques. And as … | |
Hey everyone so here's a new code and it compiles but it won't let me separate the data and add more questions for the user. Please help me and thanks in advance! I need it to enter 3 elements after list2 header file #ifndef H_myArray #define H_myArray class myArray { … | |
Hello Guys, I am trying to implement a coparison operator == into a try catch block to compare to clocks. I defined my comparator as friend bool operator ==(Clock&c1,Clock&c2) { return(c1.get_hour()==c2.get_hour() && c1.get_minute()==c2.get_minute()); } and my try catch block as Clock *clock3; try{ int hour,minute; cout<<"Hour: "; cin>>hour; cout<<"Minute: "; … | |
#include<iostream.h> void main() { int i=o; i=400*400/400; cout<<i; } i am getting a wrong output | |
| Hi together i need your help... again for my lab work. The question is the following: Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople receive £200 per week plus 9 percent of their gross sales for that week. … |
#include<stdio.h> #include<conio.h> main () { clrscr(); int a=1,b,sum; while (a<=100) { sum=0; for (b=1; b<=a+9; b++) { sum=sum+b; printf("Sum is %d.\n", sum); } a=a+20; b=a; } getch(); return(0); } -This code is supposed to print the sum of the first 100 words. Getting the sum of the first ten, skipping … | |
Enter five scores and display the lowest score and the difference of each score from the highest score. I'm so confused. I don't know if i'll use array or looping. Need you help. Thanks | |
Hi, I'm new to APIs. Got the code below to compile (with 3 warnings C4129) but it won't output to the designated path. I created the txt file ahead of time, nqquotes.txt, but after the code compiles, that file stays empty. Thanks for your help, TR #include "stdafx.h" #include <tchar.h> … | |
I have a approximate following class class ClassA : public ClassB { void HandleMessages(const u8 *pP, const u16 nMsgBodyLen); static std::map<std::pair<u32, u32>, CreateSessInfo> m_mSessionId2CCRNum2DefaultBearerId; }; When trying to access the map from the HandleMessage, I am getting the linker error, saying the undefined reference to m_mSessionId2CCRNum2DefaultBearerId; Could some c++ experts … | |
Hi, I'm new to c++ but I'm having a go trying to create a jagged array int** DATA = new int*[10]; DATA[0] = new int[100]; //this works DATA[1] = new int[100][5]; //but this don't DATA[1][100][1] = 1; Thanks |
The End.