Search found 4039 matches

by albinopapa
April 7th, 2020, 5:26 pm
Forum: Everything
Topic: Wstring ? international chars ?
Replies: 15
Views: 78

Re: Wstring ? international chars ?

Looking through a project called Crispy Doom and came across something related to what you are doing @binbinhfr unsigned int TXT_DecodeUTF8(const char **ptr) { const char *p = *ptr; unsigned int c; // UTF-8 decode. if ((*p & 0x80) == 0) // 1 character (ASCII): { c = *p; *ptr += 1; } else if ((p[0] &...
by albinopapa
April 7th, 2020, 7:24 am
Forum: Everything
Topic: Wstring ? international chars ?
Replies: 15
Views: 78

Re: Wstring ? international chars ?

Sounds like what you really need to do is make a class that sets a locale or a character set so you can determine how to handle your std::strings. Your program won't have to do a lot of conversions between character sets since that isn't the domain of your program. You just need enough of a class fo...
by albinopapa
April 6th, 2020, 2:19 am
Forum: Everything
Topic: Beginner HW 8: My solution
Replies: 1
Views: 13

Re: Beginner HW 8: My solution

Interesting approach.

You can even shorten the negateBound function

Code: Select all

int Game::negateBound(int prev, int current, int vel)
{
    return ( prev == current ) ? vel : -vel;
}
by albinopapa
April 5th, 2020, 7:19 am
Forum: Everything
Topic: Wstring ? international chars ?
Replies: 15
Views: 78

Re: Wstring ? international chars ?

If you're still looking for information and example, I just so happened to come across this on stackoverflow

https://stackoverflow.com/questions/257 ... or-wchar-t
by albinopapa
April 3rd, 2020, 7:05 pm
Forum: Everything
Topic: Test
Replies: 14
Views: 9358

Re: Test

If you are still willing @chili, I finally decided to check out the theme database and

Some suggestions:
https://www.phpbb.com/customise/db/styl ... lver_dark/
https://www.phpbb.com/customise/db/styl ... a0786c56f5
by albinopapa
April 3rd, 2020, 5:13 pm
Forum: Everything
Topic: Wstring ? international chars ?
Replies: 15
Views: 78

Re: Wstring ? international chars ?

No, I don't have that information. Localization is one thing I never planned on doing.

The SFML library has a custom String class and Utf<> template classes that deal with representing those characters, but I'm not sure about reading/writing from files with different Utf encodings.
by albinopapa
April 3rd, 2020, 9:20 am
Forum: Everything
Topic: Wstring ? international chars ?
Replies: 15
Views: 78

Re: Wstring ? international chars ?

You can try looking through this:

https://en.cppreference.com/w/cpp/locale/locale
by albinopapa
April 2nd, 2020, 8:34 am
Forum: Everything
Topic: float(i) or (float)i ?
Replies: 3
Views: 15

Re: float(i) or (float)i ?

Since C++ has constructors, int( i ) is valid whereas last time I tried that in C the compiler gave me errors.
by albinopapa
April 2nd, 2020, 8:33 am
Forum: Everything
Topic: float(i) or (float)i ?
Replies: 3
Views: 15

Re: float(i) or (float)i ?

Means the same thing.
by albinopapa
March 31st, 2020, 6:01 pm
Forum: Everything
Topic: Container : when do I need a move constructor ?
Replies: 5
Views: 29

Re: Container : when do I need a move constructor ?

In class initialization is fine and doesn't need constructors, I suppose it's like the compiler writing a constructor for it. struct Vec2{ float x = 2.f, y = -2.f; }; Here no constructors, destructors nor assignment operators need be present and the x, y members will be initialized. It's like initia...