49,755 Topics

Member Avatar for
Member Avatar for Affifa

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 )

Member Avatar for rubberman
0
30
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
1K
Member Avatar for andrew mendonca

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 …

Member Avatar for sfuo
0
324
Member Avatar for cambalinho

i have 1 class Timer. the class works fine, but when the windows loses the focus, the timer stops... why these happens?

Member Avatar for cambalinho
0
269
Member Avatar for mahmoud.beltagy95

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 ???

Member Avatar for mahmoud.beltagy95
0
106
Member Avatar for TObannion

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 …

Member Avatar for TObannion
0
183
Member Avatar for Hasheeb

#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; …

Member Avatar for dbfud1988
0
2K
Member Avatar for eliamck

As a begginner in C++ i'm having problems to use microsoft visual studio 2010. How do i go about it?

Member Avatar for ddanbe
0
63
Member Avatar for tentrabyte

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. * ** *** …

Member Avatar for dbfud1988
0
636
Member Avatar for bobtherobot

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, …

Member Avatar for NathanOliver
0
264
Member Avatar for afra afzal

#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<<" *** …

Member Avatar for tinstaafl
0
256
Member Avatar for DS9596

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) …

Member Avatar for YarMak
0
247
Member Avatar for cambalinho

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, …

Member Avatar for cambalinho
0
817
Member Avatar for DS9596

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 …

Member Avatar for YarMak
0
207
Member Avatar for Search_not

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 …

Member Avatar for Search_not
0
899
Member Avatar for myk45

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(); …

Member Avatar for myk45
0
979
Member Avatar for Luffy

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 …

Member Avatar for deceptikon
0
6K
Member Avatar for Swalih

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 …

Member Avatar for Swalih
0
3K
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
212
Member Avatar for glao

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 * …

Member Avatar for glao
0
105
Member Avatar for 35nando

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 …

Member Avatar for Abheek88
0
2K
Member Avatar for Mr.M

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 …

Member Avatar for Mr.M
0
180
Member Avatar for kARTechnology

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 …

Member Avatar for StuXYZ
0
236
Member Avatar for malcolmsand

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 …

Member Avatar for triumphost
0
9K
Member Avatar for fasihahshaharil

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

Member Avatar for rubberman
0
103
Member Avatar for Search_not

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. …

Member Avatar for rubberman
0
141
Member Avatar for fasihahshaharil
Member Avatar for rubberman
0
103
Member Avatar for dvamshi0608

if a function recives 3 pass-by-value parameters, how many actual parameters should be in call statement?

Member Avatar for rubberman
0
174
Member Avatar for PulsarScript

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?

Member Avatar for ddanbe
0
98
Member Avatar for angel6969

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 …

Member Avatar for Ariel_2
0
1K

The End.