why does it work this?

I am not so good progamming any more (since my stroke =()

This works
Serial.print(gps.distance_between(Hlat,Hlon,flat,flon));Serial.println(" meter ");

This works not
*dist = gps.distance_between(Hlat,Hlon,flat,flon);
Serial.print("dist ");Serial.println(dist);

Can someone explain, please!

/Bertil

This works not

Sure it does. It just doesn't do what you want. What does it do, instead?

Why are you saving the output in *dist, rather than dist? How is dist defined?

a stroke.. hmm your a bit like me constant headache..
maybe a mistake of syntax under c++,
i am aware of a few strange ways of typing in c++
but have not seen something like you typed.

int x=3;

x +=2; // is same as x=x+2; results in 5

x *=2 ; // performs the operation x = x * 2 results in 6 if x still was 3

x++; // x = x + 1

doing a multiply in front of a variable that you would like to assign a value..
dont think its part of c++ ?

I have half sided paralysis with aphasia and dysarthria:
I used was right-handed, but now hacks on the keyboard with the left,
therefore have little difficulty expressing myself. :frowning:

char dist[10];
/Bertil

I used was right-handed, but now hacks on the keyboard with the left,
therefore have little difficulty expressing myself.

Sorry to hear that.

char dist[10];

But, gps.distance_between() does not return a character string. It returns a float (assuming that gps is an instance of TinyGPS.

Obviously, I have serious problems with the programming!
Now I got it right! :slight_smile:

I do not know why I did not think abt that!!

Thanks for guiding me! :grin:

/Bertil

Bertil -

You spend a little time away from programming and it seems that some things just seem to get lost in the fog and you have to make a few mistakes to clear the fog. Add a stroke to that mix and I would imagine that some of that fog gets pretty thick. Good to see that you are still plugging away.

@PGTBOOS

doing a multiply in front of a variable that you would like to assign a value.. dont think its part of c++ ?

It's a pointer operation, and is quite central to C programming.
(Ok, it's possibly malformed, but that is the intention I assumed)

To all who read this thread:

Thanks for all help!

Whith aphasia I will spend 10 minutes writning this post :sweat_smile:

/Bertil