set double
set double
- Subject: set double
- From: email@hidden
- Date: Sun, 22 Oct 2006 12:51:52 +0200 (CEST)
- Importance: Normal
Hi,
Someone must have seen this before but when using xcode 2.2 to code some C++
main.cpp :
#include "test.h"
int main () {
Blabla test;
test.setVar(5);
return 0;
}
test.h:
#ifndef TEST_H
#define TEST_H
class Blabla{
public:
Blabla():var(0){};
~Blabla(){};
void setVar(double);
private:
double var;
};
#endif
test.cpp
#include "test.h"
#include <stdio.h>
void Blabla::setVar(double mvar){
printf("%lf\n", mvar);
var = mvar;
printf("%lf\n", var);
}
I would expect it to output 5 twice
like in gcc
pearl:~/testblala kris$ make
g++ -c -o test.o test.cpp
g++ -c -o main.o main.cpp
g++ -o test -Wall -g test.o main.o
pearl:~/testblala kris$ ./test
5.000000
5.000000
Makefile :
objects = test.o main.o
output = test
CFLAGS = -Wall -g
LFLAGS =
CC = g++
$(output): $(objects)
$(CC) -o $(output) $(CFLAGS) $(objects) $(LFLAGS)
clean:
-rm -f *.o *.core $(output)
Thanks for feedback,
Kris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden