49,761 Topics

Member Avatar for
Member Avatar for R3AL

I have the following code: [CODE]HWND hwn= FindWindow(NULL,"CABAL"); HDC hdc = GetDC(hwn); COLORREF x; POINT m; m.x=50; m.y=50; ScreenToClient(hwn,&m); x=gp(hdc,m.x,m.y); if(x==CLR_INVALID) cout<<"CLR_INVALID\n"; cout<<"Red: "<<(int)GetRValue(x)<<"\n"<<"Green: "<<(int)GetGValue(x)<<"\n"<<"Blue: "<<(int)GetBValue(x)<<"\n"; [/CODE] The problem is gp( GetPixel ) always returns CLR_INVALID and white (255,255,255). Also, I find it strange that SetPixel works with any coordonates. …

Member Avatar for R3AL
0
174
Member Avatar for Motifaithed

Hi Everyone, I'm new to C++ and developing something to enhance my skill, however I find it difficult on my knowledge right now, I want to write a program similar to SMS that everytime I input a character it will automatically increase my counter, and if i will press backspace, …

Member Avatar for harinath_2007
0
154
Member Avatar for existence19

SORRY I TRIED TO INDENT THE CODE BUT IT DIDNT WORK OUT I am trying to make a binary tree for conversion of postfix to infix. the binary trees class is as follows WHAT I HAVE TO DO AND WHAT I AN HAVING TROUBLE WITH 1) READ A POSTFIX EXPRESSION …

0
66
Member Avatar for rjcenteno

i have a program that reads in a file with shapes and numbers and tokenizes each line. after it tokenizes, it then calculates the shapes dimensions. what i need to do is make it so that this program reads in the file and stores every shape and its values into …

Member Avatar for rjcenteno
0
183
Member Avatar for GatorProgrammer

I am required to compute all Lucas numbers up to a certain number. To keep track of a summation, more specifically, the summation of all Lucas numbers you have encountered up to that point. A small example: If the user inputs a bound of 23: Lucas numbers up to 23 …

Member Avatar for mike_2000_17
0
166
Member Avatar for Zssffssz

Ok here is what I am asking: is there any simple way to use program to program communication in a console application. Like one asks for a number and the other displays it?

Member Avatar for Zssffssz
0
99
Member Avatar for mac.jpr

[CODE]#include<iostream> #include<math.h> using namespace std; main() { int i; float j=1.00; cout<<"enter a no"<<endl; cin>>i; float k=(float)(log (i)/log(2)); k=k%j;//------------------error-------… "%" cann`t take float vlaue. if(k==0.00) cout<<"no "<<i<" is a power of 2"<<endl; else cout<<"sorry ! i am afraid "<<i<<" is not a power of 2"<<endl; } [/CODE] i tried this …

Member Avatar for boddurakesh
0
332
Member Avatar for Spontaneous

Here is a task out of a book [quote]Your task is to write a C++ program to help you convert a number into roman numerals. Roman numerals are I for 1, V for 5, X for 10, L for 50, C for 100, D for 500, and M for 1000. …

Member Avatar for Spontaneous
0
621
Member Avatar for coolbeanbob

Hello, I am getting an error when I try to pass a linked list and an iterator to the printList function below. For some reason it does not recognize the printList function call. I get the following error on line 39. no matching function for call to 'printList(std::_List_iterator<Event, std::allocator<Event> >&' …

Member Avatar for coolbeanbob
0
440
Member Avatar for Demetrio.pepi

Can someone send me a example of how to copy a file from a remote folder to other remote folder? For example: I am running MyProgram on MyComputer and this program has to copy a file from a folder inside OtherComputer. This folder need user and password to allow MyProgram …

Member Avatar for harinath_2007
0
180
Member Avatar for sofia24

Hi, I'm writing a C++ script and part of it is to connect to an SQL Server. C++ is new to me so I'm still working my way around. Any help would be greatly appreciated. Many Thanks

Member Avatar for Stefano Mtangoo
0
1K
Member Avatar for zendet

Hey im just trying to get back into c++ and i cant seem to solve why this is happning? I know theres too many header files also, i just normally leave them there in practise things when im messing with colours etc. Could you also please explain why it is …

Member Avatar for frogboy77
0
143
Member Avatar for rarment

I'm just starting to learn C++ and I need some help. I need to be able to read in a text file and pull out numbers from the file (like a news story, etc). I will need to be able to do other checks with the numbers as well, I'm …

Member Avatar for rarment
0
295
Member Avatar for hairo

Hi friends, I need to convert this random number generator in C++ to C. Please help me. C++ code [CODE] #include <iostream> #include <ctime> using namespace std; //This class will give satisfy basic // random number considerations for // games an general apps. // WARNING: Not for Cryprographic use // …

Member Avatar for hairo
0
715
Member Avatar for cent91

i wanna use the Sleep fucntion in a CLR vc++ app, if i include windows.h it gives a huge list of errors, if i use _sleep() then it dowsnot work at many systems since its obslete. what should i do? i am bound to use CLR bcoz my code uses …

Member Avatar for cent91
0
427
Member Avatar for nzdude09

[code] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int guess; unsigned int seed = time (0); srand (seed); //different spot?// int upperBound; int lowerBound; int range; char c; bool done = false; do { bool found =false; upperBound = 101; lowerBound = 1; do …

Member Avatar for Moschops
0
247
Member Avatar for hqt

Who can teach me the purpose of stringStream, and how to use it, please. I have read some paper about this, but I still have something don't understand.

Member Avatar for raptr_dflo
0
140
Member Avatar for trejorchest

Here is the assignmnent I need to complete: "Write a program to calculate and print the result of the following two operations: 1/1 + 1/2 + 1/3 + 1/4 + 1/5 + ... + 1/99999999 + 1/100000000 and 1/100000000 + 1/99999999 + 1/99999998 + 1/99999997 + ... + 1/3 + …

Member Avatar for raptr_dflo
0
361
Member Avatar for bravo1382

Hello all, I am fairly new to c++ and I am completely lost right now. I am suppose to create two dynamic arrays that prompt the user to enter how big the arrays should be and it also asks the user to enter the numbers they want to store in …

0
98
Member Avatar for dan_code_guru

I tried to use the code on MSDN to create Rawinput but i kept getting this error: RAWINPUTDEVICE was not declared in this scope. I am writing in c++ and direct x and i am using Code Blocks [ICODE] void RawInput(void) { RAWINPUTDEVICE Rid[2]; //keyboard Rid[0] .usUsagePage = 1; Rid[0] …

Member Avatar for sfuo
0
249
Member Avatar for iamthesgt

I am writing a program that writes log entries to an external text file and returns them upon request. When called, the return function should output the log entries between two user- submitted dates or outputs the last 100kb of the file if that's what's requested. The logfile stores each …

Member Avatar for raptr_dflo
0
198
Member Avatar for ben1996123

[code]#include <direct.h> int main(){ mkdir("C:\\Program Files\\Bacon"); }[/code] Creates a folder in the folder that the .exe file is in, and is called "Program FilesBacon". I think it's obvious what I wanted it to do. Help please? I'm using codeblocks if it matters.

Member Avatar for gihanbw
0
140
Member Avatar for Godservant1

Someone gave me this challenge See how large a type is by storing powers of 2 in this list of types: float, double, long double. To determine if a number will fit, start with 1.0, double it, then divide by 2 to see if you get the previous number. For …

Member Avatar for nyquist
0
143
Member Avatar for ixmike88

hello, i started programming again after a while and i made this just to pass time/relearn the basics and stuff there is a weird issue that i can't figure out, when i input row 0 column 2 or row 1 column 2 it will fill the spot for both the …

Member Avatar for coltonbyu
0
827
Member Avatar for alexanderlegend

Hello everyone! I have been working on a sudoku generator. My main aim is to create a completed 9x9 grid that follows the rules of sudoku. The grid should display unique numbers every time it is run i.e the numbers have to be randomised. My logic in tackling the problem …

Member Avatar for alexanderlegend
0
6K
Member Avatar for kevinyu

I'm try to make a program that will ask a user to input a string then the string gets masked (by asterisks) and later, guess every letter (character) of the masked word until the string is fully unmasked (a la Hangman). But my problem is, after the first unmasking, the …

Member Avatar for pseudorandom21
0
201
Member Avatar for mcconnell_34

Hey, I need to know what identifier i can use instead of string that will output all of the words that you type in the program. For example: if i was to use string ans1; cout <<"How are you?: "; cin >>ans1; and for my answer i typed "very good"...it …

Member Avatar for Narue
0
181
Member Avatar for ntrncx

i am fixing something and i have that fuction in it [CODE]bool DeckOfCards::checkFlush(const Card checkCards) { counter=0; cardCheck=" "; for(int x=1;x<5;x++) { cardCheck=checkCards.suits[x]; for(int y=0;y<5;y++) { found=hand[y].find(cardCheck); if(found!=string::npos) { counter++; } } if(counter==5) { return true; } counter=0; } }[/CODE] it goes here: [CODE]bool result=false; if((result=checkFlush(checkCards))==true) { return winner=5; }[/CODE] …

Member Avatar for ntrncx
0
153
Member Avatar for Vusumuzi

Hello I'm looking for a javascript I can use to rotate my 10 images on 10 seconds interval.

Member Avatar for Vusumuzi
0
95
Member Avatar for nav010

Hello Everyone Currently, I am using system("dir") method to call system calls. I want to know any other method for system calls in VC++ 2008. How can I call system call in VC++2008 without using system(" ") method? Any help would be appreciated Thanks

Member Avatar for krishnad
0
139

The End.