49,761 Topics
| |
I have this assignment: Write a program with three functions: upper, lower, and reverse. The upper function will accept a pointer to a string or C-string as an argument. It will step through each character in the string converting it (where necessary) to uppercase. The lower function will accept a … | |
[Linux] I have had a hard time understanding pointers beyond a simple array step through and modifying one address at a time. When I get into pointers to C-structures, C++-objects and classes my head starts to hurt. And that's just to name a few. I find the C syntax `*++p` … | |
Hi, I need your help please..I am given the following data and I need to write C++ commands to get the array filled... a[source][destination]=some value how to write C++ code for the following? loop condition can be used a[0][0]=0; a[0][1]=1; a[0][2]=1; a[0][3]=1; a[0][4]=3; a[0][5]=2; a[0][6]=3; a[0][7]=3; | |
My main issue here actually is Visual Studio installer (just could not find a specific category above). So here is my poblem. Visual Studio won't progress installing. Once it reaches the Visual Studio C++ Runtime version (and some numbers), it does not progress any further. I even tried leaving my … | |
How does this code work?? I am at a loss how the tail recursion works here? #include<iostream.h> #include<conio.h> void back(void); void main(void) { cout<<"Enter a sentence: "; back(); getch(); } void back(void) { char ch; ch=getche(); if (ch!='\r') {back(); cout<<ch;//Read a character, print the rest of the input in reverse, … | |
| |
finally i have the static control transparent: //creating the form: hwnd = CreateWindowEx(0, classname, strCaption.c_str(),WS_OVERLAPPEDWINDOW | WS_TABSTOP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, mod, this); //sending a message for subclassing: case WM_CTLCOLORSTATIC: { return DefWindowProc(HandleWindow, msg, wParam, lParam); } break; //heres how i create a static control with ownerdraw style: … | |
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 control have the WS_TRANSPARENT style. and: case WM_ERASEBKGND: { return TRUE; } break; case WM_CTLCOLORSTATIC: { return (LRESULT)GetStockObject(NULL_BRUSH); } break; case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; image imglabel(test->rcItem.right-test->rcItem.left,test->rcItem.bottom-test->rcItem.top); if(inst->blnTransparent!=true) FillRect(test->hDC,&test->rcItem, CreateSolidBrush(inst->clrBackColor)); else FillRect(test->hDC,&test->rcItem,(HBRUSH) GetStockObject(NULL_BRUSH)); FillRect(imglabel,&test->rcItem,CreateSolidBrush(inst->clrBackColor)); if(inst->imgtest.haveimage()) DrawHICONtoHDC(imglabel, inst->imgtest,1,1); SetBkMode(imglabel,TRANSPARENT); char *text=(char*)inst->strCaption.c_str(); SetTextColor(imglabel,inst->clrTextColor ); DrawTextEx(imglabel,text,-1,&test->rcItem,DT_LEFT,NULL); if(inst->blnBorder==true) DrawEdge(imglabel, &test->rcItem,BDR_SUNKENINNER | BDR_RAISEDOUTER,BF_RECT); … | |
Hello all, I am having trouble with my programming assignment in which we have to build a MIDI scale player. I am willing to send the assignment brief and my current to anyone willing to help. Cheers, Ben | |
when the form is activated: case WM_ACTIVATE: { if (wParam==WA_INACTIVE) { SetWindowText(inst->hwnd,"unactivated"); FormActivated = NULL; } else { SetWindowText(inst->hwnd,"activated"); FormActivated = inst->hwnd; } return 0; } break; when i create the timer: case WM_CREATE: { if(WindowMain == NULL || WindowMain ==GetDesktopWindow()) { WindowMain = HandleWindow; } SetTimer(inst->hwnd,JoystickTimer,150,NULL); SetTimer(inst->hwnd,KeyBoardTimer,150,NULL); SendMessage((HWND)lParam , … | |
Please help me I'm getting frustrated. #include <iostream> #include "unorderedArrayListType.h" using namespace std; int main() { int intList = new intList(8); int number; cout << "Enter 8 Integers: "; for (int count = 0; count < 8; count++) { cin >> number; intList.insertEnd(number); } cout << endl; cout << "Int … | |
[QUOTE]Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need to be read in from standard input and printed out in sorted (ascending) order, each on a line by itself. Furthermore, there are no duplicates in the … | |
How do i write a program that computes the sum of all even numbers in a range forexample between 1 and 100 | |
Hi fellow members, I have wrote two abstract classes, with the second inheriting from the first. However, I receive this error when I try to compile: "error C2143: syntax error : missing ',' before '<'." Will somebody help me out? Thanks! template <class DataType> class AbstactArrayClass { friend ostream& operator … | |
Write a nested loop for C++ to produce the following pattern if the user input is 5? ----1 ---22 --333 -4444 55555 (-) accounts for number of spaces before each number | |
Max and min come out wrong, they go to 0's when it outputs ? How do I fix, any solutions?? #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { int x, y, z; int total; float average; //Read data into x, y, z void ReadData(int & x, … | |
I did it like this and it somewhat works but I have problem with the middle name such as Barrack Hussein Obama. How do I make it so it ignores the middle name and just gives me the last name??? #include <iostream> #include <iomanip> #include <string> using namespace std; int … | |
Every programming language provides different features to make coding task easy. One of the main objectives is to keep things simple as possible. You have studied C++ in this course and have learnt many different concepts e.g. input/output, if-else statements, loops, arrays, functions etc. Looping constructs are needed when a … | |
I am new to Dev C++ and i am creating a program of a game of snake. In Dev C++ the graphics open in WINDOWS BGI screen whereas the text gets shown in Text console(Dos). 1)i want to know how can i clear the WINDOWS BGI screen ? 2)how can … | |
write a function to calculate the maximum number of four numbers notice that the four numbers will be entered by the user | |
Hey guys... I have Borland C++ compiler with version 5.02. The problem is that once I run the code, it makes and just flashes and disappears. I mean, in a simple 'hello world program', the program just cout 'hello world' and closes itself. I tried getch(); and it did work, … | |
Hi, Our teacher explains nothing, he expects us to learn from reading the book. I need help on how to start this assigment. I have attached the assigment. | |
I need to check my code has all these requirements. The requirements for “main()” are: a. Use an object. b. Declare all required variables. c. Output user information. d. Input the radius 1 and radius 2 to be used to calculate the area of two circles. e. Use object Circle … | |
A language expert Mr. ABC objects the designers of C++ on the bases of following two arguments: A single looping construct is sufficient to cover all types of situations. Designers of C++ have not done any good with themselves and C++ programmers by making things complex with provision of three … | |
It lets me continue the loop but it won't let me enter a sentence the second time?? #include <iostream> #include <iomanip> #include <string> #include <cctype> using namespace std; int main() { char c, response; int Uc = 0, Dc=0, Vc=0, Wc=0; string vowels("aeiouAEIOU"); cout << "I can count the number … | |
I need to output the smallest number that is entered. I can't seem to figure out how to do it though. Thanks in advance. small.cpp #include <iostream> #include <algorithm> #include "arrayListType.h" using namespace std; int main() { arrayListType<int> intList(100); // int min(int first, int last); int counter; int number; cout<< … | |
Create a C++ console applications to compile the following statistics on a list of integers: minimum value; maximum value; median value; arithmetic mean; absolute deviation variance (of a discrete random variable); standard deviation (of a finite population); mode (including multi-modal lists). … |
The End.