49,755 Topics
![]() | |
how we calculate this x%=y*3 where x= 10 , y = 5 after calculation x= ? (we know that x%=y equals to x= x%y and the prcedence will be from left to right ) | |
i'm owner draw some controls. here what i use for a button: case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; HIMAGELIST imlIcon=ImageList_Create(inst->imgtest.width(),inst->imgtest.height(),ILC_COLOR,1,1); ImageList_Add(imlIcon,inst->imgtest,NULL); HTHEME hTheme = OpenThemeData(inst->hwnd, L"BUTTON"); //fill the background with button face color FillRect(test->hDC, &test->rcItem,(HBRUSH) GetSysColor(COLOR_BTNFACE)); if ( test->itemState & ODS_SELECTED) // If it is pressed { DrawEdge(test->hDC,&test->rcItem,EDGE_SUNKEN,BF_RECT); // Draw … | |
I am trying to create a recursive function: double fifthRoot(double x, double maxError) In this function, I have to return y such that y^5 will be within maxError of x. Assume x > 0. Also assume maxError is big enough to prevent problems due to rounding. In order to make … | |
i have 1 class Timer. the class works fine, but when the windows loses the focus, the timer stops... why these happens? | |
what if I wanted the user to enter his birth month and I don't know whether the user input is integer or string for example july or 7 what should I do ??? | |
So here is my assignment: File name: project1.cpp You work for the Jet Propulsion Laboratory. They want you to write a program that will take a two-dimensional array containing the digitized representation of a picture of the night sky and locate the stars on it. The array elements are integers … | |
#include<conio.h> #include<iostream> #include<stdlib.h> using namespace std; class SStack { private: int *arr=NULL; int top=0; public: SStack(int size) { arr=new int[size]; } SStack() { arr=new int[5]; } void push(int x) { if(top>5) { cout<<"stack is full"; return; } arr[top++]=x; cout<<"successfully inserted:"<<x; } void pop() { if(top<0) { cout<<"stack is empty"; return; … | |
As a begginner in C++ i'm having problems to use microsoft visual studio 2010. How do i go about it? | |
Guys I need some help... This is my program... #include<iostream> using namespace std; int main() #include<iostream> using namespace std; int main() { int a=1; int b=5; cout<<"*"; cin>>a; while <a=>5>; { cout<<"*"; ++a } return 0; } { And this will be the output of my program. * ** *** … | |
I'm writing a piece of code for a class, and part of it is to take an operation on integers and store it in a double (without any truncation). I'm trying to use the static_cast <double> (EXPRESSION GOES HERE); form, but it isn't working. When I output the new value, … | |
#include <iostream> #include <string> using namespace std; { int counter=0; string Username; string Password; string InvalidUser; int opt; system("cls"); cout <<"\n\n"; cout << " ====== MEDICARE HOSPITAL LOGIN ======="; cout<<"\n"<<endl; cout<<"\n"<<endl; cout<<"\n"<<endl; cout<<" *** ****** ******* ************* **** *** "<<endl; cout<<" *** ******** ********* ************* ***** *** "<<endl; cout<<" *** … | |
Can someone check if I am doing these right please, thanks ? int a=3, b=5, x; x= a/b + b/a +a%b + b%a; cout << x; // x=0+1+0+1= 2 y=float(b/a)+ float(b)/a; cout << y; // y=1.6+1=2.6 z=a*b/2; cout << z; // z= 4 w=pow(b, a)+sqrt(a+b); cout << w; // w=125+2sqrt(2) … | |
i can show an icon on notify area: NOTIFYICONDATA NID; //on main NID.cbSize = NOTIFYICONDATA_V2_SIZE; //if i use the NOTIFYICONDATA_V3_SIZE //the compiler enters on conflits NID.hIcon = test2; NID.uCallbackMessage = WM_USER + 1; NID.hWnd = a; NID.uID = 01; NID.uVersion=4; NID.uTimeout=500; NID.dwInfoFlags = NIIF_INFO; strcpy(NID.szInfoTitle, "Test Title"); //NID.hBalloonIcon=(HICON)test2;//no member strcpy(NID.szTip, … | |
So I have this so far, not sure how to make dollars * e^(rate*time) #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { //declare identifiers double rate = 1; double time = 2; float dollars; float total=0.0; //initialize identifiers total= pow(exp(1.0), rate*time); cout << fixed << showpoint … | |
![]() | I want to read text from a file and display it in the win32 Edit(ReadOnly). I am having problems converting from std::string to w_char*/LPWCSTR. The program reads the text from the textfile into a vector<std::string> object. I want to display each item in the vector on a new line inside … ![]() |
Hi All, I'm trying to use bools to sync between two threads. I cant' use C++11 and I thought mutexes would be slightly heavy for this. So, I do something like this: // ================================== // Thread A .. do some stuff .. // wait for signal. while (!signalFromThreadB) { pthread_yield(); … | |
hello guys.. i hope you can help me for this codes.. im trying to make a program that will accept username and password in c++. im using turbo c++ ide 3.0 "not dev c++". here is my code.. but the problem is.., i want to use * to appear as … | |
I'm trying to write 2 dimensional array of int type to a binary type file. int array[3][3]={Some data}; ofstream f; f.open("nameoffile.dat",ios::binary||ios::out); for(i=0;i<=3;i++) { for(j=0;j<=3;j++) { f.write((char *)&array[i][j],sizeof(array)); } } f.close(); Above code is not complete. I only wrote a part of the code where I need help. Is this code … | |
my image class can read animated gif's. using a timer i can change the menu item image. but when the menu item is showed, how can i refresh it? (i have tryied the DrawMenuBar() and SetMenu() without sucess. the image is, only, updated when i move the mouse from 1 … | |
Hello , I wanted to ask why this works? int *p = new int[ 1 ]; for ( int i = 0; i < 5; i++ ) { p[i] = i; } for ( int i = 0; i < 5; i++ ) { p[ i ] = 2 * … | |
Hi, I'm looking for a library which provides edge detecion on color image. For example i have an 200x200 color image and i need to a table form it: bool is_edge [200][200]; Where is_edge[x][y] == true when there is edge in pixel [x,y] Sorry form my english, waiting for some … | |
Hi Dw I'm new in C++ and I'm trying to develop an interactive app. I want for instance to run the app and have options printed then I choose one option then the app load relevant screen. Suppose it an ATM app where you chose what transaction you want to … | |
Hi, I'm new here :) the problem is if i increment one member, for eg --------------------------------------- struct day { int hour[40]; int min[40]; int mins[40]; int rec; int totmins; int totsal; char status; int temp; }; struct month { struct day *da;}; struct year { struct month *mn;}; struct roll … | |
Hello guys, I have a problem with Win32 C++ GUI. I'm creating a program and as one of the steps, I want to: 1. Let the user type somthing in the textbox, 2. Show it in another box/area, 3. Clear the typed text from the textbox. It would be something … | |
help me please to answer this simple coding...i'm very weak in coding...pleasee,tomorrow my lecturer want to see my work.... :( help me frienddsssssssss..............help meee | |
![]() | I am writing to a file using a pointer variable that points to my File object, which includes the method used to write to my text file. When I try to delete the memory my program crashes... The error does not occur when I comment out the "delete file;" line. … |
if a function recives 3 pass-by-value parameters, how many actual parameters should be in call statement? | |
Here is the file.The idea is to create phone book, and retrieve items from menu. The error i have with ofstream method. And in generlal is structure/layout of program correct? | |
I am having some trouble with this program .. if input is abaabcdbab output should read abcd.... program is supposed to delete the repeated characters and output only one of each character but it is not working .... and ideas would be welcome //Reads the letters in an array and … |
The End.