Both declare instances of a button:
The first form declares an
instance of an Fl_Button class called 'fltkButton'.
This instance and name has a lifetime up to the closing
brace for the block
of code it's declared in (which is main()). When the
closing brace is reached,
the instance is automatically destroyed. This is
similar to declaring a
variable in C; if you declare 'int x = 0;' it will be
created and visible up
until the closing brace.
The second form declares a pointer
called fluidButton, and initializes it
to point to an instance of Fl_Button created with
'new'. The instance's
lifetime makes it available until the pointer is
destroyed with 'delete',
and the pointer's lifetime is only visible until the
closing brace, unless
the pointer is saved somewhere else.
Both button instances are 'initialized' with the x,y,w,h values
and the
button name ("button1" for the first, and "button2" for the
second).
And due to how FLTK operates, the buttons are automatically
parented
to the window that is declared above the buttons. In fact any
FLTK widgets
created after the declaration of the window will automatically
be parented
to the window, up until the window's end() is invoked, ending
the auto-parenting.
It would help if you're familiar with plain old C, as creating
instances of classes
(e.g.
Fl_Button foo(..)) is very much like instancing
simple integer variables
(e.g.
int foo = 0;).
And instancing pointers to classes (e.g.
Fl_Button *pfoo =
new Fl_Button(..))
is very similar to instancing pointers to integers (e.g. '
int
x = 0; int *px = &x;')
C++ classes are just more complex objects than an 'int', but are
created/destroyed in much the same way.
I know assembly too, and I'm not sure there's an easy way to
describe
the above C and C++ concepts in assembly, as automatic variables
and variable name scope aren't really built into assembly
language,
though these concepts can kinda/sorta be supported by the
assembler,
and/or limiting variable scope to modules (.obj's) in the same
way
variable scope is limited to {} blocks in C/C++.