Pointer in FB

New to FreeBASIC? Post your questions here.
Post Reply
PeterHu
Posts: 152
Joined: Jul 24, 2022 4:57

Pointer in FB

Post by PeterHu »

Greetings to everybody!

Just a newbie to FB,and curious can pointer in FB do everything that c does?

Thanks for the help in advance.

Peter
PeterHu
Posts: 152
Joined: Jul 24, 2022 4:57

Re: Pointer in FB

Post by PeterHu »

And,can anybody here guide me what's the better(structural way) to learn FB under Windows,from 0 to intermediate level ?Thanks again.
Vortex
Posts: 118
Joined: Sep 19, 2005 9:50

Re: Pointer in FB

Post by Vortex »

Hello,

Why not to start by studying the latest FreeBASIC manual?

Code: Select all

FB-manual-1.09.0.chm
deltarho[1859]
Posts: 4308
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Pointer in FB

Post by deltarho[1859] »

PeterHu wrote:can pointer in FB do everything that c does?
Not able to answer that.

However, here are two excellent tutorials on FB pointers.

Pointer Data Type
Pointers and Composite Types
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Re: Pointer in FB

Post by angros47 »

PeterHu wrote: Jul 24, 2022 5:03 Just a newbie to FB,and curious can pointer in FB do everything that c does?
Basically, yes, because they work in the same way.
The main difference with C is about arrays pointers (since in FreeBasic they point to the descriptor, not to the actual data) and string pointers (since strings are managed differently in FreeBasic and in C)
There are simple workarounds in both cases, like using a pointer to the first element of the array or to the first character of a string, and also, FreeBasic can use c-like arrays or strings (with zstring PTR)
PeterHu
Posts: 152
Joined: Jul 24, 2022 4:57

Re: Pointer in FB

Post by PeterHu »

Many thanks to all of you!
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Pointer in FB

Post by fxm »

PeterHu wrote: Jul 24, 2022 5:03 ... can pointer in FB do everything that c does?
You can look in the Comparison of C/C++ and FreeBASIC documentation page some types of syntaxe comparisons relating to pointers.
Post Reply