Search found 1648 matches

by angros47
May 25, 2020 14:19
Forum: General
Topic: C++ ABI Compatible?
Replies: 25
Views: 1522

Re: C++ ABI Compatible?

There is a simpler workaround: in "base", you can add the line: declare virtual destructor declare virtual sub dummy_destructor 'This function will fill a space in the vtable Since the method "dummy_destructor" does not exist in the exported class, you have to add it in Freebasic...
by angros47
May 24, 2020 22:26
Forum: General
Topic: C++ ABI Compatible?
Replies: 25
Views: 1522

Re: C++ ABI Compatible?

Here is an example: File class.cpp : #include <iostream> using namespace std; class base { public: base(); virtual ~base(); virtual void print() ; virtual void show() ; }; class derived : public base { public: derived(); virtual ~derived(); void print() ; void show() ; }; base::base(){ cout << "...
by angros47
May 24, 2020 21:57
Forum: General
Topic: C++ ABI Compatible?
Replies: 25
Views: 1522

Re: C++ ABI Compatible?

Interesting .... I was trying to interface FreeBasic with a class written in C++ and compiled with GCC Normal methods worked as expected, but virtual methods seemed to be "shifted by one". Basically, calling one virtual method from FreeBasic activates the previous virtual method in the C++...
by angros47
May 21, 2020 16:37
Forum: General
Topic: Keywords in TYPEs
Replies: 1
Views: 295

Keywords in TYPEs

Why is

Code: Select all

type foo extends object
   declare sub cls()
end type


while

Code: Select all

type foo extends object
   declare sub end()
end type


gives "error 4: Duplicated definition, found 'end' in 'declare sub end"?
by angros47
May 21, 2020 15:58
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

Last XKCD comic seems appropriate for albert: Image
by angros47
May 20, 2020 21:37
Forum: General
Topic: C++ ABI Compatible?
Replies: 25
Views: 1522

Re: C++ ABI Compatible?

What are the main differences in vtable? What is that is NOT supposed to work, specifically?
by angros47
May 18, 2020 22:42
Forum: Tips and Tricks
Topic: FLTK GUI without C wrapper
Replies: 6
Views: 772

Re: FLTK GUI without C wrapper

Improved Fl_Widget.bi type Fl_Image_ as Fl_Image type Fl_Font_ as Fl_Font type Fl_Window_ as Fl_Window type Fl_Gl_Window_ as Fl_Gl_Window type Fl_Widget_ as Fl_Widget type Fl_Group_ as Fl_Group extern "c++" type Fl_Label value as zstring ptr image as Fl_Image_ ptr deimage as Fl_Image_ ptr ...
by angros47
May 14, 2020 20:12
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

Perfect encryption is nothing new https://en.wikipedia.org/wiki/One-time_pad Basically, even with the simplest encrypting algorithm, if the encryption key is as long as the message, it's impossible to decrypt it (a brute force approach will be useless if there is no way to check the correctness of t...
by angros47
May 13, 2020 23:07
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

Albert, you promised to stop posting your compressing code until you had a working decompressor: https://freebasic.net/forum/viewtopic.php?p=271960#p271960

So, please, keep your word.
by angros47
May 12, 2020 23:21
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

Albert, do you know that "MOD" stands for "modulus", not for "moderator", right?
by angros47
May 09, 2020 17:41
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

No, it's simple: there are 4! (factorial of 4) permutations, or 4 *3 *2 * 1= 24 permutations. In fact the first digit can have 4 values (0 to 3). The second can have three values (all but the one used in the first digit), the third can have the remaining two values, and the last one must have the on...
by angros47
May 09, 2020 0:09
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

But if outs2 =1, you only know that v1 and v2 are different, you don't know which one is greater. So you can't know if you must add or subtract to v1 to get the value of v2
by angros47
May 08, 2020 19:32
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

if v1 is "1110" and v2 is "1111" it will output the same as if v1 is "1110" and v2 is "1101".

So, 11101111 and 11101101 will produce a duplicate.

Albert, when will you realize that your approach will ALWAYS produce duplicates?
by angros47
May 07, 2020 22:38
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

1010101 is 1-010-101 or 101-010-1?
by angros47
May 07, 2020 18:11
Forum: General
Topic: Squares
Replies: 8041
Views: 507631

Re: Squares

What happens if you have to compress any sequence made by 8 bit starting with 100? Like 10010101 ?
How can you distinguish it from a 6 bit sequence?

Go to advanced search