Updated Frequently asked Questions for using Raylib with C Plus Plus (markdown)

master
Jeffery Myers 3 anni fa
parent
commit
475bb8bdb5
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      Frequently-asked-Questions-for-using-Raylib-with-C-Plus-Plus.md

+ 1
- 1
Frequently-asked-Questions-for-using-Raylib-with-C-Plus-Plus.md

@ -8,7 +8,7 @@ Raylib works with C++ in the exact same way it does with the C language. You can
No, Raylib-CPP is not required to use Raylib with C++. Raylib-CPP is an optional wrapper that sits on top of the regular C Raylib in order to provide object oriented access to Raylib. Raylib-cpp still calls the same C Raylib in the end.
# I Get an error on code like this when building an example in C++ `(Vector3){1.0f,2.0f,3.0f}`. How Can I fix it?
# I Get an error on code like this 'a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax' when building an example in C++ `(Vector3){1.0f,2.0f,3.0f}`. How Can I fix it?
This type of structure initialization `(Vector3){1.0f,2.0f,3.0f}` is called a compound literal and is not supported by C++. Some C++ compilers are strict and will not allow it. This code can be converted to brace initialization in C++ by simply removing the parentheses around the type. Changing the code to `Vector3{1.0f,2.0f,3.0f}` will fix the error. This change needs to be made for code that is pulled from the Raylib C examples.

Caricamento…
Annulla
Salva