Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why does not MS only use the { } when define the Macro? Pin
yu-jian11-Apr-12 20:15
yu-jian11-Apr-12 20:15 
AnswerRe: Why does not MS only use the { } when define the Macro? Pin
CPallini11-Apr-12 22:31
mveCPallini11-Apr-12 22:31 
GeneralRe: Why does not MS only use the { } when define the Macro? Pin
yu-jian11-Apr-12 23:52
yu-jian11-Apr-12 23:52 
GeneralRe: Why does not MS only use the { } when define the Macro? Pin
CPallini12-Apr-12 2:55
mveCPallini12-Apr-12 2:55 
JokeRe: Why does not MS only use the { } when define the Macro? Pin
Rajesh R Subramanian12-Apr-12 5:10
professionalRajesh R Subramanian12-Apr-12 5:10 
GeneralRe: Why does not MS only use the { } when define the Macro? Pin
CPallini12-Apr-12 7:57
mveCPallini12-Apr-12 7:57 
AnswerRe: Why does not MS only use the { } when define the Macro? Pin
hebegumeci15-Apr-12 9:21
hebegumeci15-Apr-12 9:21 
Questiontemplate/callback function question Pin
remstadt11-Apr-12 13:24
remstadt11-Apr-12 13:24 
Hi I'm trying to get this to work, but I'm not sure how to get the right syntax.

template <int N>
double array_sum(double * var[N], int n, double (*f)(double var[N])) {
  double ret 0.0;
  for (int i = 0; i < n; ++i) {
    ret += f(args);
  }
  return ret;
}

double mul(double var[3]) {
  return var[0] * var[1] * var[2];
}

int main() {
  double * length = new double[10];
  double * width = new double[10];
  double * height = new double[10];
//initialize the data
  array_sum({length, width, height}, 10, mul);
  delete [] length;
  delete [] width;
  delete [] height;
  return 0;
}


The function should give the volume of the described element, but vstudio says that no template matches the given data.

Thanks in advance,
G

Hah, ok I solved it, and yeah there are some syntax arguments in this, but I'll still leave this open to the group to have fun with.

modified 11-Apr-12 20:03pm.

AnswerRe: template/callback function question Pin
Stefan_Lang17-Apr-12 2:15
Stefan_Lang17-Apr-12 2:15 
QuestionUltimate Grid Pin
ITISAG11-Apr-12 12:09
ITISAG11-Apr-12 12:09 
AnswerRe: Ultimate Grid Pin
Chandrasekharan P11-Apr-12 19:39
Chandrasekharan P11-Apr-12 19:39 
AnswerRe: Ultimate Grid Pin
Mohibur Rashid11-Apr-12 20:05
professionalMohibur Rashid11-Apr-12 20:05 
QuestionApplication migration from Visualstudio 2008 to visual studio 6 Pin
Member 881287111-Apr-12 7:57
Member 881287111-Apr-12 7:57 
AnswerRe: Application migration from Visualstudio 2008 to visual studio 6 Pin
Chris Losinger11-Apr-12 8:10
professionalChris Losinger11-Apr-12 8:10 
GeneralRe: Application migration from Visualstudio 2008 to visual studio 6 Pin
KRISHNARAYALU11-Apr-12 11:10
KRISHNARAYALU11-Apr-12 11:10 
QuestionHow to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 3:37
Falconapollo10-Apr-12 3:37 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Richard MacCutchan10-Apr-12 5:34
mveRichard MacCutchan10-Apr-12 5:34 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:42
Falconapollo10-Apr-12 22:42 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Richard MacCutchan11-Apr-12 0:01
mveRichard MacCutchan11-Apr-12 0:01 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Tox1k10-Apr-12 15:09
Tox1k10-Apr-12 15:09 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:41
Falconapollo10-Apr-12 22:41 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
ThatsAlok10-Apr-12 22:23
ThatsAlok10-Apr-12 22:23 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo10-Apr-12 22:39
Falconapollo10-Apr-12 22:39 
AnswerRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Randor 11-Apr-12 4:26
professional Randor 11-Apr-12 4:26 
GeneralRe: How to force to kill the specific progress on Win7 X64 Ultimate? Pin
Falconapollo11-Apr-12 4:34
Falconapollo11-Apr-12 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.