Forum: C++ Oct 24th, 2005 |
| Replies: 13 Views: 9,162 template member functions may not be virtual but often you can get around this by templating a class rather than a member function. The only reason you cant have template member functions is because... |
Forum: C++ Oct 12th, 2005 |
| Replies: 1 Views: 7,312 there is a need and a reason to return arrays and it can be done, you just return a pointer to its first address. If what you meant was an array return by value, i.e. a copy of the array then yes... |
Forum: C++ Oct 11th, 2005 |
| Replies: 6 Views: 8,129 private inheritance has its uses. It is similar in effect to composition and nothing like public inheritance. When you become more familiar with c++, you will often find uses for private inheritance. |
Forum: C++ Oct 11th, 2005 |
| Replies: 6 Views: 8,129 no its not legal. because you have used private inheritance your class now looks like this.....
class Bird
{
public:
Bird();
virtual ~Bird();
private:
void... |
Forum: C Oct 11th, 2005 |
| Replies: 4 Views: 1,725 i prefer....
WINDOWPOS* wp = (WINDOWPOS*)lParam; |
Forum: C Oct 11th, 2005 |
| Replies: 4 Views: 1,725 pWinPos is not constant. but you do need a cast. either an old c style or a reinterpret_cast<WINDOWPOS*>(lParam) |
Forum: C Oct 7th, 2005 |
| Replies: 1 Views: 1,476 look up....
WM_QUERYENDSESSION
WM_ENDSESSION |
Forum: C++ Oct 6th, 2005 |
| Replies: 2 Views: 8,794 it is. passing a pointer is no different to passing anything else. Its a parameter the same as any other. |
Forum: C Oct 5th, 2005 |
| Replies: 3 Views: 1,179 post your score class and we will take a look for you. there isnt enough code to help there. It appears that maybe you have forgotten to write a member func or something similar. |
Forum: C Oct 5th, 2005 |
| Replies: 2 Views: 1,172 fmod() can be used with doubles. perhaps your compiler has an fmod that accepts long doubles too. |
Forum: C Oct 5th, 2005 |
| Replies: 8 Views: 1,691 Im with narue on this one. I cannot believe you have taught operating system design yet code a small sample with 9 lines on which 2-3 will cause errors. You seem to think the OP will have some clue... |
Forum: C++ Oct 4th, 2005 |
| Replies: 4 Views: 3,168 well in c++ you dont need to do that. you can get input like this....
int an_int;
while( ! cin>>an_int )
{
// didnt get an int so deal with that here
cin.clear(); // clear error flags
... |
Forum: C++ Oct 4th, 2005 |
| Replies: 8 Views: 14,305 you appear to be mixing managed and unmanaged c++. I dont think you can do that although I aint sure i dont use managed c++ |
Forum: C Oct 4th, 2005 |
| Replies: 1 Views: 1,526 >>>pls give me an advice
you could start by posting your code and details of any errors you get and we'll help you fix it. |
Forum: C++ Oct 4th, 2005 |
| Replies: 2 Views: 4,180 something like
long long int summation(long long int start, long long int howMany)
{
long long sum=0;
for(long long i=0,j=start;i<howMany;++i,++j)
sum += j;
return sum;
} |
Forum: C Oct 4th, 2005 |
| Replies: 7 Views: 2,250 biggest overheads with goto is having your peers laugh at you.Also a goto in a function will make life hard for the optimiser to do its job properly so your function may go unoptimised. It is not... |
Forum: C Oct 4th, 2005 |
| Replies: 1 Views: 2,288 static int func(); // proto for a static func
class AClass
{
friend int func(); // can be a friend and retains its static linkage
friend int anotherfunc(); // assumed to have external... |
Forum: C++ Oct 4th, 2005 |
| Replies: 4 Views: 3,168 perhaps if you explain better what you are trying to do. maybe a small code sample. Why would you need to type check after a cin. |
Forum: C++ Oct 2nd, 2005 |
| Replies: 2 Views: 1,136 Its extrememly dated. If you are in any way serious about programming you will want the best tools you can get for free or for the money available. There are many compilers available for free on the... |
Forum: C++ Oct 2nd, 2005 |
| Replies: 11 Views: 2,551 understand what the code is doing. In main you make an input file and read it a line at a time. You then pass that line to myjob::read. This is where the parsing occurs. first an istringstream is... |
Forum: Game Development Oct 2nd, 2005 |
| Replies: 2 Views: 3,821 Loads here (http://nehe.gamedev.net) |
Forum: C++ Sep 30th, 2005 |
| Replies: 8 Views: 14,305 |
Forum: C++ Sep 30th, 2005 |
| Replies: 1 Views: 1,193 |
Forum: C++ Sep 29th, 2005 |
| Replies: 8 Views: 14,305 look up in your helpfiles or at msdn....
the third param to WinMain to get command line as ascii
GetCommandLine() to get the command line as unicode
CommandLineToArgvW() to convert it to an... |
Forum: C++ Sep 29th, 2005 |
| Replies: 2 Views: 1,312 we dont do your homework, we only help when you show effort. |
Forum: C++ Sep 28th, 2005 |
| Replies: 1 Views: 7,342 know how to write a text file? should be examples in all c++ texts. or alternatively there are a couple of libraries available to do logging, check on sourceforge. |
Forum: C Sep 28th, 2005 |
| Replies: 2 Views: 4,096 |
Forum: C++ Sep 28th, 2005 |
| Replies: 10 Views: 2,654 What compiler are you using?
You will need something reasonably standards conforming. You can get one in my sig. |
Forum: C Sep 28th, 2005 |
| Replies: 4 Views: 1,399 And I have told you how they do that. Part of the bootup process is a process called userinit.exe. This is the process that basically starts off the shell once the OS has loaded. You replace the... |
Forum: C++ Sep 28th, 2005 |
| Replies: 10 Views: 2,654 what I meant is illustrated below. it breaks my heart to write all of this in the main function but it seems as if you havent learnt functions yet so I tried not to get too far ahead. I have shown... |
Forum: C++ Sep 27th, 2005 |
| Replies: 10 Views: 2,654 ok then.
firstly the correct header is <iostream> not <iostream.h>.
using std::cout;
using std::cin;
using std::endl;
can be removed. You have already said that you are using the whole of... |
Forum: C Sep 27th, 2005 |
| Replies: 1 Views: 2,033 windows 2k
null pointer assignment 0x00000000-0x0000ffff
user mode 0x00010000-0x7ffeffff
64kb off-limits 0x7fff0000-0x7fffffff
kernal-mode 0x80000000-0xffffffff
windows 98
null pointer... |
Forum: C++ Sep 27th, 2005 |
| Replies: 10 Views: 2,654 post some code to show you have attempted the problem if you want help. We dont handfeed you homework answers but will happily help you out if you show effort. |
Forum: C++ Sep 26th, 2005 |
| Replies: 2 Views: 2,210 ptr.speak();
ptr.move();
ptr.printName();
not . its -> |
Forum: C Sep 25th, 2005 |
| Replies: 2 Views: 2,476 |
Forum: C Sep 25th, 2005 |
| Replies: 4 Views: 1,399 1) the standard way to do this is to replace userinit.exe in a certain registry key with your app. at the end of your app you must start userinit.exe to complete the bootup.details at msdn just... |
Forum: C++ Sep 25th, 2005 |
| Replies: 13 Views: 2,641 int a=rand();
int b=rand();
int c=rand();
std::vector<int> vec;
vec.push_back(a);
vec.push_back(b);
vec.push_back(c);
std::cout<< *std::min_element(vec.begin(),vec.end())<<std::endl;
not a... |
Forum: C++ Sep 25th, 2005 |
| Replies: 15 Views: 3,507 yes it is standard, but it took a while for some compilers to catch up, most notably msvc6. There is also a nothrow version of new specified by the standard. |
Forum: C++ Sep 25th, 2005 |
| Replies: 8 Views: 2,101 you cant. watch.
int x=0; // global x
int main()
{
int x=1; // main x
{
int x=2; // block x
cout<< x<<endl; // prints block x |
Forum: C Sep 21st, 2005 |
| Replies: 2 Views: 5,532 What OS?
bmp is easy. the others require more work. |