Up |
|
|
  |
Author: D. SusmanD. Susman
Date: Feb 17, 2008 23:13
Hi,
I wonder if there is a way to introduce polymorphic parameters to a
macro. What I'm trying to say is: Say, I have a macro X taking
argument of type A*. Let there be a B class deriving from class A. Can
I pass a B to the macro as a pointer to A?
(One might say, "use templates anyway". I am applying a memory pool
mechanism and wrapping new and delete with macros New and Delete
correspondingly)
Thanks.
|
| |
|
| |
2 Comments |
|
  |
Author: Samant.TruptiSamant.Trupti
Date: Feb 17, 2008 22:44
Has any one know how can I change registry permission
programmatically. I tried regini.exe bit it is changing permission
for that particular folder or key. I want to apply that permission
change for complete tree.
|
| |
|
| |
1 Comment |
|
  |
Author: Gerry FordGerry Ford
Date: Feb 17, 2008 21:41
I've been pecking away at writing a program that will calculate the inner
product of two double-width four-vectors.
Larry thinks I'm well started with the following source to populate a
vector:
#include
#include
#include
#include
#include
int main() {
std::vector four_vector;
for (double i=0.0; i<4.0; i++)
four_vector.push_back(sqrt(i));
std::cout.precision(16);
std::copy(four_vector.begin(), four_vector.end(),
std::ostream_iterator(std::cout, "\n"));
return 0;
}
|
| Show full article (1.50Kb) |
|
22 Comments |
|
  |
Author: mathudivmathudiv
Date: Feb 17, 2008 21:34
hi,
i want to call main( ) in one program as a fuction from some other
main().
now i am working in vc++ 2008..
i need all ur suggestion to complete my project
|
| |
|
7 Comments |
|
  |
Author: joeschmoe98joeschmoe98
Date: Feb 17, 2008 16:21
i know that:
double *a[n]; is an array of n pointers
double (*b)[n]; is pointer to array of size n
but what is:
double ( *c[n] )( ); and
double ( *d( ) )[n];
|
| |
|
7 Comments |
|
  |
Author: Kira YamatoKira Yamato
Date: Feb 17, 2008 13:28
A question about declaring a friend class. The following does not compile:
template
class B
{
public:
friend class C;
};
g++4.0.1 returns the error message
error: using template type parameter 'C' after 'class'
So, is there a way to declare a friend class from the template parameter?
--
// kira
|
| |
|
12 Comments |
|
  |
Author: Kira YamatoKira Yamato
Date: Feb 17, 2008 12:00
Ok, I'm trying to do something funky here, just to see how much the C++
syntax can be stretched. Here's the problem I was trying to solve.
Suppose you have the following common situation of a class A with two
accessor methods for x:
class A
{
public:
int get_x() const;
void set_x(int);
};
Normally, we would have the following syntax:
// (1)
A a;
a.set_x(3);
int y = a.get_x();
However, let's say I want to implement the following syntax instead
|
| Show full article (1.77Kb) |
|
2 Comments |
|
  |
Author: RajtomarRajtomar
Date: Feb 17, 2008 11:18
i have small gaem which pick a word randomly from a list of 100 four
letterd words and asks user to guess it, when user inputs it, program
compares the inputted word with the randomly picked word and return
results, user gets 10 chances to guess the correct word. famous "COWS
n BULLS" now the problem is that program has 4 options ,start ,
resume, help screen and exit. now if a user wants to see help screen
in between the game , the current game will be lost and a new game
will start on selecting start.
i want that if a user selects help screen in between a running game
then the screen should be copied and should be printed on rselection
of resume.
any ideas ???????
|
| |
|
1 Comment |
|
  |
Author: RajtomarRajtomar
Date: Feb 17, 2008 11:18
i have small gaem which pick a word randomly from a list of 100 four
letterd words and asks user to guess it, when user inputs it, program
compares the inputted word with the randomly picked word and return
results, user gets 10 chances to guess the correct word. famous "COWS
n BULLS" now the problem is that program has 4 options ,start ,
resume, help screen and exit. now if a user wants to see help screen
in between the game , the current game will be lost and a new game
will start on selecting start.
i want that if a user selects help screen in between a running game
then the screen should be copied and should be printed on rselection
of resume.
any ideas ???????
|
| |
|
1 Comment |
|
  |
|
|
  |
|
|
|
|
|
|