|
I am putting it inside sturct, Becase I want to pass it as parameter to Thread along with other attributes
|
|
|
|
|
The basic problem is you are assigning a const pointer to a non-const pointer . Well, if you want to keep the consts in the function signature, then possible get arounds are
1) Make the Scope *_this; as const. The only problem is since its a const member, you've to initialize it by constructor. So your code snippet will change like this -
typedef struct THREADSTRUCT_SCOPE
{
THREADSTRUCT_SCOPE( const Scope* ptr )
: _this( ptr )
{}
const Scope *_this;
}THREADSTRUCT_SCOPE;
And allocate it like this,
bool Scope::searchABCByAttributes()
{
THREADSTRUCT_SCOPE *_param= new THREADSTRUCT_SCOPE( this );
...
}
1) You can also use cstyle casting or const_cast to remove the constness. But its not recommended. It can be done as follows. Just FYI.
_param->_this = (Scope*)this;
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
but now I had #error WINDOWS.H already included. MFC apps must not #include <windows.h>
|
|
|
|
|
Well, thats your next compiler error to fix!
As the error says - check whether windows.h is included in your project and remove it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
If I remove it these two error flashes
but really ";" was not missing
.h
THREADSTRUCT_SCOPE *_param;
static UINT WorkerThread(LPVOID param);
: error C2146: syntax error : missing ';' before identifier 'WorkerThread'
: error C2061: syntax error : identifier 'LPVOID'
|
|
|
|
|
Instead of windows.h , include StdAfx.h header. Add it to the beginning of file before all other #includes.
#include "StdAfx.h"
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
it gives new error, i belive some wrong ...........
ilapeeimpbatch.hh(665) : fatal error C1004: unexpected end of file found
|
|
|
|
|
1) Check the points described here - http://msdn.microsoft.com/en-us/library/4exw7xyc(VS.71).aspx[^]
2) Since the error is from header file, did you forget to put semi column after the class declaration?
If these points didn't resolve issue, please post your entire header file.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am new to win 32 sdk programming. Please tell me how to load and display an existing bmp image file in my window which is also created dynamically.Please do help me out.
Thnx in advance.
|
|
|
|
|
|
Thnx for the help.I'll chk out the link.Thnx once again.
|
|
|
|
|
|
|
Write a C++ program that reads N numbers from the keyboard, calculates and displays the
following information.
1. sum of all positive numbers
2. average of first and last numbers
3. factorial of largest number
4. 70% of smallest positive number
5. first two numbers in ascending order
6. last two numbers in descending order
N should be declared as a constant in your program and it should be equal to the largest digit of your
student id number. eg take number as 8
The program should use the formats for inputs and outputs as given in the example below. In this
example, it is assumed that N is equal to 3 but in your program N should be equal to the largest digit of
your student id number.
Example:
Program Input
Enter 3 numbers:
Number 1: 3
Number 2: -5
Number 3: 4
Program Output:
Sum of all positive numbers: 7
Average of first and last numbers: 3.5
Factorial of largest number: 24
70% of smallest positive number: 2.1
First two numbers in ascending order: -5 3
9
Last two numbers in descending order: 4 -5
The program should contain only a main function. User defined functions and arrays should not be used
in this assignment. If you use arrays or functions, you will be penalised 25% of the total marks for the
assignment. You should also not use things which are not part of this course. You will be penalised 25%
of the total marks for the assignment, if you use things (eg. classes, linked list, etc.) which are not
covered in this course.
|
|
|
|
|
Send the rest of the homework please and do deposit something in my account. I have started working on both or ur problems
By the way do you have some SRS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
you're an idiot.
you don't even take in account the good advices major members can have made to you earlier.
you know what ?
If you can't do your assignment yourself, Programming Computers is definitely the wrong way for you.
maybe you should consider changing of carreer now !!
|
|
|
|
|
rameshkalavala wrote: you will be penalised 25% of the total marks
Well, don't be afraid, a 25% penalization on 0 make you still at 0, so you won't loose anything...
|
|
|
|
|
rameshkalavala wrote: Write a C++ program that reads N numbers from the keyboard, calculates and displays the
following information.
Done.
|
|
|
|
|
sum of all positive numbers in c++ visual basics
thanks
ramesh
|
|
|
|
|
|
rameshkalavala wrote: sum of all positive numbers
Guess what???
Firstly you landed in the wrong place to ask this question and secondly we are way past our age when we did homeworks.
rameshkalavala wrote: in c++ visual basics
wht's that. neither C++ nor VB. do you want to use both the languages in order to solve this
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Think of the insanity of your question. Since numbers are infinite, how can you expect a finite machine to be able to sum them? Computers are definitely not, or at least shouldn't be, in your future.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Just give him the code, and let him have a try. That way we won't have to deal with him as he waits for the program to finish...
And if he would pull it off (and end up with the number 42 - of course), you'd get the credit for providing the source code. It's a win/win situation.
Last modified: 29mins after originally posted --
|
|
|
|
|
Jörgen Sigvardsson wrote: And if he would pull it off (and end up with the number 47 - of course)..
Haven't more numbers been discovered since then?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|