Forum: C++ Oct 20th, 2009 |
| Replies: 3 Views: 209 double calculateAverage(double Number, double Sum)
{
return (Number * 1.0) / Sum;
}
You have to divide Sum by Number , not the Number by sum. |
Forum: C++ Sep 8th, 2009 |
| Replies: 19 Views: 617 as the way you speaks you know nothing about C++ right ? you know C up to now.So that ithelp's C book will do the best for you and I recommand it.
Anyhow it's not a free book. Anyway if you can... |
Forum: C++ Sep 2nd, 2009 |
| Replies: 6 Views: 377 delete is a C++ keyword so use a different identifier other than
delete.
and also use the delete keyword to delete the arrays that you no
longer using. ( I mean inside that function ).... |
Forum: C++ Sep 2nd, 2009 |
| Replies: 7 Views: 287 dev is a IDE not a compiler , the compiler that dev uses is the mingw.
can I know precisely why you need to implement a new #pragma
directive. for me I rarely use ( less than 10) pargma... |
Forum: C++ Sep 2nd, 2009 |
| Replies: 7 Views: 287 nop visual C++ does provide you some #pragma directives.
But it not let you to extend this.
These are the only pragma that you can use.
... |
Forum: Geeks' Lounge May 8th, 2009 |
| Replies: 14 Views: 1,198 learning algorithms
algorithm that generates random numbers. |
Forum: Geeks' Lounge Apr 25th, 2009 |
| Replies: 89 Views: 4,588 True , he got the experience becos of his age. But no-one have the
right to insult some other filed of expertise using that expertise.
use this experience for good . and I want to say you that... |
Forum: Geeks' Lounge Apr 25th, 2009 |
| Replies: 89 Views: 4,588 finish this guys :
somebody loves java somebody loves C++ and somebody
loves C and may be assembly.
we are not here to tell my language is better than you'rs.
This is a badddd mistake that... |
Forum: Geeks' Lounge Apr 23rd, 2009 |
| Replies: 89 Views: 4,588 that means I agree with Narue
and ppl who are interested in other than C++ it's good for them. But
C++ is also good. |
Forum: Geeks' Lounge Apr 23rd, 2009 |
| Replies: 89 Views: 4,588 source: Think in C++ free book.
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
we also say that C++ is also a productive programming language.
Read the first chapter , you will get the... |
Forum: Geeks' Lounge Apr 23rd, 2009 |
| Replies: 89 Views: 4,588 not only the Narue will hate you , all the C++ community will
hate you. Please don't talk like this. Even think that I feeling
hard time learning java and java GUI , it is not a good
idea to... |
Forum: C++ Apr 18th, 2009 |
| Replies: 26 Views: 1,659 just get the stack trace and get see what's the function calls it until
you find your code.Then check the parameter values. |
Forum: C++ Apr 18th, 2009 |
| Replies: 3 Views: 298 Hmm , good question , I have the past experience with dealing these
type of question. where you have to consider is list <myPacket> will
have a default constructor and a copy constructor and a... |
Forum: Assembly Apr 14th, 2009 |
| Replies: 2 Views: 530 LOL !
my idea is a newbie should be new , why he should learn win32 or 32 bit assembly.so
http://www.jorgon.freeserve.co.uk/GoasmHelp/Hello64World1
is the first program.and toochain is goAsm ,... |
Forum: C++ Apr 10th, 2009 |
| Replies: 7 Views: 870 #include <iostream>
using namespace std;
class car {
public:
car (float speed) :
speed(speed) {}
car () :
speed(0) {} |
Forum: C++ Apr 10th, 2009 |
| Replies: 7 Views: 870 I have compiled your mentioned source by the microsoft C++ compiler too. the same error message is there.
error C2385: 'racetank::car' is ambiguous
So it's not a compiler bug or compiler... |
Forum: C++ Apr 4th, 2009 |
| Replies: 10 Views: 1,850 l seen soemthing like this in the OpenCV libraries. |
Forum: C++ Mar 26th, 2009 |
| Replies: 13 Views: 451 It's oky , try to get the value as a return value. Or there are other ways.
But for now ( for easy underestand ) try it using a return value. |
Forum: C++ Mar 26th, 2009 |
| Replies: 13 Views: 451 #include "include.h"
#include "menu.h"
#include "exit.h"
#include "login.h"
int main()
{
int success =0;
login(); |
Forum: C++ Mar 26th, 2009 |
| Replies: 13 Views: 451 you should return 0 if success otherwise return -1
#include <include.h>
#include <exit.h>
int login()
{
string username; //This is a string variable calld username(string variables r 4... |
Forum: C++ Mar 26th, 2009 |
| Replies: 13 Views: 451 you should let execute printMenu() call if only success. If not just print a "Invalid user " message.
you can change your method
void login()
to
int login(); |
Forum: C++ Mar 25th, 2009 |
| Replies: 5 Views: 376 IDEA:
if you want to write
Player p ;
[code]
like that you should define the default values for your overloaded constructor .Like this
[code]
class Player{
private: |
Forum: C++ Mar 24th, 2009 |
| Replies: 14 Views: 1,196 WPARAM is availiable in the LowLevelMouseProc procedure.
I think you can use it.
and you can process that structure to get x and y values out.
see... |
Forum: C++ Mar 24th, 2009 |
| Replies: 5 Views: 376 If you overload the default constructor then the compiler no longer put a default constructor ( this is not just a rule there is a reason for this think why ? )
So you can't say
Player p ; |
Forum: C++ Mar 24th, 2009 |
| Replies: 5 Views: 376 and for your first question (C2512) , just google that error and
you will find the answer. I can't post duplicate here. It's violation of member rules.
the problem is think that , if you call
... |
Forum: C++ Mar 24th, 2009 |
| Replies: 5 Views: 376 #include "stdafx.h"
class Player{
private:
int x;//player x/y position
int y;
public:
Player(int _x, int _y);//constructor |
Forum: C++ Mar 24th, 2009 |
| Replies: 14 Views: 1,196 I don't know this will be really useful . Sounds like there is no direct way to just pass it directly. looks like You have to use the LowLevelMouseProc and it's LPARAM is the
pointer to... |
Forum: C++ Mar 24th, 2009 |
| Replies: 14 Views: 1,196 These information are simple. WPARAM HIWORD contains the y location and the WPARAM LOWORD contains the x position.
EDIT: Opps sorry ,
MouseProc doesn't input that LPARAM no ?
anyway I write a... |
Forum: C++ Mar 24th, 2009 |
| Replies: 14 Views: 1,196 are you trying to write a keylogger or something like that ?
am I correct ? Then using that program you are recording something
. some key strokes and mouse evens like this.
Yes you can do this... |
Forum: C++ Mar 22nd, 2009 |
| Replies: 17 Views: 1,104 double P[1000], V[1000], T[1000];
Next time try to use a STL vector for this . you can make a struct that contains int P , int V and int T and make a vector of that struct. And Feel free to... |
Forum: C++ Mar 20th, 2009 |
| Replies: 12 Views: 569 You means a dialog ?
well here is the source code . Note that DLG_MAIN is comming from the resource.h. That ID that you given in the resource editor.
#include "stdafx.h"
#include <windows.h>... |
Forum: C++ Mar 20th, 2009 |
| Replies: 12 Views: 569 here is a tutorial if you using Dev C++ IDE.
http://www.technohug.net/profiles/blogs/1987837:BlogPost:75464 |
Forum: C++ Mar 20th, 2009 |
| Replies: 12 Views: 569 There is nothing special way to use it. It's like you asking how to use the notepad in windows.
Just design your resource using the resource editor. and save it where your project source files... |
Forum: C++ Mar 19th, 2009 |
| Replies: 5 Views: 377 good you have taken some courage .
if you still can't underestand why look at this code and
think why ?
int simDiceThrow(int maxNumber, int &total)
{
int pvalue; |
Forum: C++ Mar 19th, 2009 |
| Replies: 6 Views: 812 class enigma
{
private:
public:
enigma()
{
cout << "new enigma" << endl;
plug_board board_1;
reflector reflect_1; |
Forum: C++ Mar 19th, 2009 |
| Replies: 5 Views: 377 if (isEvenSided(pvalue) != false) {total++;}
How can you compute the total outside the loop ? you should
pass the total also as a reference. And inside the function you
can make it to zero... |
Forum: C++ Mar 16th, 2009 |
| Replies: 5 Views: 296 if your input set ( problem space ) is a random set. Then burte forcing is the only way. Even backtracking is also impossible. |
Forum: C++ Mar 3rd, 2009 |
| Replies: 5 Views: 842 #include "stdafx.h"
#include <iostream>
using namespace std ;
#include <string>
using std::string ;
#include <windows.h> |
Forum: C++ Mar 3rd, 2009 |
| Replies: 5 Views: 842 * Edit using the L prefix to the variables
Looks like the latest versions of the C++ specification allows.
However no one is going to keep all the spec in mind.
sorry about it.
however... |
Forum: C++ Mar 3rd, 2009 |
| Replies: 5 Views: 842 typedef char* LPCSTR;
typedef wchar_t* LPWCSTR;
#ifndef _UNICODE
#define LPCTSTR LPCSTR;
#else
#define LPCTSTR LPWCSTR;
#endif |