Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, VoroneTZ, AndrewAMD), 834 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: What's stopping you from actually learning programming? [Re: 3run] #452869
06/29/15 14:03
06/29/15 14:03
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
http://boredzo.org/pointers/

"bzzzt"

not able to check on my laptop now , but assuming differences between c and c++ ,are also something you might want to look at.

wil check out your example later.


Last edited by Wjbender; 06/29/15 14:07. Reason: bloody mistypes

Compulsive compiler
Re: What's stopping you from actually learning programming? [Re: Wjbender] #452871
06/29/15 14:56
06/29/15 14:56
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
okay so heres what's up .

throw away the debug_var

and

try

printf("%d %d %d",(long)*p,(long)*p2,(long)*p3);


Compulsive compiler
Re: What's stopping you from actually learning programming? [Re: Wjbender] #452875
06/29/15 15:40
06/29/15 15:40
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you for pointing this out! laugh

So I guess we've found just another bug? grin BTW, it works without typecasting, I mean without (long), while manual says that's it important to typecast var to double or long.. Anyway why it's needed?

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What's stopping you from actually learning programming? [Re: 3run] #452881
06/29/15 16:18
06/29/15 16:18
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
I think it would be beneficial to mention or ask Jcl about debug_var , I have no idea how it works (formatting and types/pointers/adresses) , I tried applying type casting inside of debug_var to no avail so I am guessing it casts or something in thw function itself (no idea)

I guess some formatting parameter support for debug_var would be cool ,since it outputs in text anyway !!


Compulsive compiler
Re: What's stopping you from actually learning programming? [Re: 3run] #452905
06/29/15 22:15
06/29/15 22:15
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Originally Posted By: 3run
Thank you for pointing this out! laugh

BTW, it works without typecasting, I mean without (long), while manual says that's it important to typecast var to double or long.. Anyway why it's needed?

Best regards


well , gamestudio automatically converts most variables of type var , to most of the correct needed types , however the var type itself is different as you know , the "var" type is almost an all rounder in litec , it can be a number a handle a pointer , as a number it could become an int or whatever automatically done by gamestudio where it knows the type it has to be casted/converted to , however this particular case i took it as ,implicitly instructing /controlling the type , because functions like printf can support multiple types it wouldn't be obvious to the engine what type I need , I have to tell it exactly what I want.

in this case there were no actual "var" instead there were purely "int" types used , but "int" and "long" are also much the same thing , but printf accepts char* , int , and double no var or float support for arguments (according to manual) so therefore you need to typecast "var" to long for integers and double for non-integers explicitly .

I really did not need to cast , just a habbit which I dragged along with me ,because of the var type I had to get used to , and it stuck ,that plus to me %I make sense more than %d..


Compulsive compiler
Re: What's stopping you from actually learning programming? [Re: Wjbender] #452913
06/30/15 10:05
06/30/15 10:05
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you very much for such a clear explanation laugh Now it's time to continue my journey with c#

My best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What's stopping you from actually learning programming? [Re: 3run] #452916
06/30/15 12:55
06/30/15 12:55
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
I see if you did this

int a=*p;

debug_var (a.....

that the str_for_num (NULL,vv) which is debug_var , would work no problem .

sooo , I don't know why string functions do not work with dereference , could it be because its a dereference to different types ?

no idea , but yeah


Compulsive compiler
Re: What's stopping you from actually learning programming? [Re: Wjbender] #452917
06/30/15 13:34
06/30/15 13:34
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
lite-c does auto-pointer-casting, it's fucked up tongue


Visit my site: www.masterq32.de
Re: What's stopping you from actually learning programming? [Re: Wjbender] #452918
06/30/15 13:52
06/30/15 13:52
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Wjbender
sooo , I don't know why string functions do not work with dereference , could it be because its a dereference to different types ?
yeah, I would like to know why too laugh

Originally Posted By: MasterQ32
lite-c does auto-pointer-casting, it's fucked up tongue
doesn't it get turned off with pragmatic_pointer?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: What's stopping you from actually learning programming? [Re: 3run] #452919
06/30/15 13:54
06/30/15 13:54
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
no, PRAGMA_POINTER only enforces -> instead of ., the manual states some other things as well, but i never noticed this stuff.

also lite-c messes up var/int/long when you cast them implicitly


Visit my site: www.masterq32.de
Page 4 of 5 1 2 3 4 5

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1