|
#include <iostream>
#inlcude <fstream>
#include <iterator>
#include <algorithm>
using namespace std;
int main ()
{
ifstream ifs("C:\\a.txt");
ifs >> noskipws; // We want white space.
copy(istream_iterator<char>(ifs), istream_iterator<char>(), ostream_iterator<char>(cout));
}
Steve
-- modified at 7:13 Wednesday 8th March, 2006
|
|
|
|
|
Hi,
I know virtual and heap memory use paged memory, but what is un-paged memory? Is it local and global variables?
Neil
-- modified at 4:22 Wednesday 8th March, 2006
|
|
|
|
|
The unpaged pool is where memory is allocated by the kernel and drivers which isn't paged out; it's always available without having to load it from disc. It is used to store information which must be instantly available such as data needed to service interrupts as such. It is of no real interest application developers.
Steve
|
|
|
|
|
Thanks Stephen.
What about local and global memory? Is all types of variables Virtual, ie paged?
Neil
|
|
|
|
|
By local and global memory I assume you referring to the LocalAlloc and GlobalAlloc APIs. These two APIs are vestiges of the old 16 bit days - In modern Windows these are just allocated memory from a normal heap. Or perhaps you are referring to local vs global variables - A local variable is a variable that only exists in a specific scope and is no longer valid when that scope exits.
Steve
|
|
|
|
|
can u just me any book regarding the explanation
Thanx in advance
never say die
|
|
|
|
|
Sorry, I don't know of any such books.
Steve
|
|
|
|
|
hello all,
I want to know how to add tooltips to the hover buttons.
I got this hover button class from one codeproject article.even they gave code for adding tool tips.but it is not working in my project.
So plz help me to add tooltips to hover buttons.Its very urgent.
thanks in advance
cheers
sangeet
-- modified at 4:15 Wednesday 8th March, 2006
|
|
|
|
|
ramyasangeet wrote: I got this hover button class from one codeproject article
You should ask this question to the author of the article.
Nibu thomas
Software Developer
|
|
|
|
|
thanks for ur reply
cheers
sangeet
|
|
|
|
|
hi,
I have downloaded "Magnifying Glass" by "Alex FR" ,application from codeproject.How do we activate the .exe with hokey.........When it in systemtray.
Thanks before
James rocky
|
|
|
|
|
RockyJames wrote: How do we activate the .exe with hokey
Create a shortcut to the executable by right-clicking on it and selecting "Create Shortcut". Move the shortcut to the desktop. Right-click on the new shortcut and select "Properties". On the "Shortcut" tab you can specify a hotkey combination for it.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
_outp(0x64, 0xad); // disable the keyboard
|
|
|
|
|
Hi friends,
1) Can I modify the printer job from Queue and add water mark to it..?
2) Is there any way to remove printer JOB from printer queue programatically?
Vikram S
|
|
|
|
|
vikrams wrote: 1) Can I modify the printer job from Queue and add water mark to it..?
No.
vikrams wrote: 2) Is there any way to remove printer JOB from printer queue programatically?
EnumJobs() will let you enumerate all the current jobs, and then SetJob() can be used to cancel it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi all
i want to create an instance of a class which is specified in a variable
say CString csClassName( "MyClasss" );
In this case i want to create an instance of MyClass.
Is there any way to do this without using any switch cases or if elses ..
Thanks in advance
divin
|
|
|
|
|
Hi all
i want to create an instance of a class whoes class name is stored in a variable;
say
CString csClassName( "MyClass" );
i want to create an instance of "MyClass"
How it is possible without using any switch cases or if else....
Thanks in advance
divin
|
|
|
|
|
Simple answer: no it is not possible. But if you need such a mechanism, you can perhpas use map tables ? You link a name to instance of a class.
Anyway, if you describe exactly your problem, maybe we can help you.
|
|
|
|
|
i'm not about what you need.
if you want to assign a string member the name of its class, then i advise you doing like that (i put the member in protected scope so that the member can been seen even when the class is derived, and i use static so that the member is shared b/w all the instances of the class. const is because the member might not change during the life of the objects) :
MyClass.h
class MyClass {
protected:
static const std::string m_strClassName;
public:
MyClass(void);
MyClass(const MyClass&);
};
MyClass.cpp
MyClass::MyClass(void)
: m_strClassName("MyClass") {
}
MyClass::MyClass(const MyClass& myClass)
: m_strClassName("MyClass") {
}
then you can use the class like any other :
MyClass c1, c2;
MyClass c3(c1);
|
|
|
|
|
As u have declared it in .h file
static const std::string m_strClassName;
u have to define it in .cpp file otherwise it will give u an error
MyClass:: m_strClassName("MyClass");
This serve ur purpose rahter assign it in constructor
never say die
|
|
|
|
|
sunit5 wrote: u have to define it in .cpp file otherwise it will give u an error
i assign it in the constructors initialization list :
MyClass::MyClass(void)
: m_strClassName("MyClass") {
}
this works and the user of the class don't have to verify the field is correctly initialized
|
|
|
|
|
This is showing me
m_strClassName' : cannot initialize static class data via constructor
C:\abc\abc.cpp(76) : error C2438: 'm_strClassName' : cannot initialize static class data via constructor
never say die
|
|
|
|
|
oh
i forgot that static member specific initialization way...
sorry again
|
|
|
|
|
Its ok
never say die
|
|
|
|
|
divine_augustine84 wrote: i want to create an instance of a class whoes class name is stored in a variable
What does this mean?
My guess is that the problem is that "the class to create is not known at compile time and might be a user provided setting".
If this is the case there is quite an elegant solution for the problem called the "factory design pattern".
Of course this design pattern is completely covered in the book by GoF called Design Patterns[^].
You may also check out this[^] article written by Chris Lasater.
As for how to map the class name to some kind of an ID for which class to create, I have the same suggestion as Cedric: use a map, e.g. std::map.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|