Ludovic 'Archivist'
Can i use Allegro as a GUI? If so any resources to learn Allegro?
If you rach the point where you wonder about that use SDL2 instead
'''''''
If you rach the point where you wonder about that use SDL2 instead
I just visited their site and it was all about making games. But I wanna build a simple quiz platform and I need a simple GUI like tkinter .
Anonymous
sizeof is a presude operator , means that compiler will replace the sizeof operator with type's size in compile time, rather than runtime. is it right?
Ludovic 'Archivist'
Can i use Allegro as a GUI? If so any resources to learn Allegro?
Allegro: https://liballeg.org/docs.html SDL2: https://wiki.libsdl.org/ Generally 2D drawing libraries are used for games, but they can be used for GUI just fine. SDL2 suit better that duplicity and has better tools for displaying text
@𝑺𝒐𝒃𝒌𝒂
No idea, don't use QT
Why? What you recommend? It's a destop application
Talula
Why? What you recommend? It's a destop application
If you want Native and free, than Pascal (Lazarus).
Tunechi
Hello guys
Anonymous
Helloooooo
@𝑺𝒐𝒃𝒌𝒂
C#, not C++
I didn't learn these languages (neither C# nor Pascal) May be I should try other design.
@𝑺𝒐𝒃𝒌𝒂
Thank for helping
Tunechi
Helloooooo
How are you doing
Talula
I didn't learn these languages (neither C# nor Pascal) May be I should try other design.
Well C# isn't much different but don't try to do GUI frontend in C++... learning C# isn't too hard.
Talula
why not to use C++ ?
No garbage collector... pointers pointers everywhere.
佳辉
yup
How to write pseudocode of simple calculator?
佳辉
Almost same as algorithm?
Kamuri
https://pastebin.com/eEp7jL6a
uhh your code is so hard to read. You've created a main function inside of a main function? Why? anyway, about ur problem: in lines 15 and 16 you declare start and help functions inside the main. No problem. That time the are non static. But when you redeclare them inside your main, they are defined as static by the compiler (at least is what i think?), so they cannot be accessed by external functions. A solution would be to remove the lines 15 and 16 and move all your help and start functions to the head of the function they are defined in. (the concepts may be wrong and if someone could correct me would be great. But the solutions works)
@𝑺𝒐𝒃𝒌𝒂
No garbage collector... pointers pointers everywhere.
VLC and other great GUI applications were written in cpp. I guess there is some way to handle these issues.
Hermann
is it possible to convert the contents of the uint32 pointer to a string?
Talula
VLC and other great GUI applications were written in cpp. I guess there is some way to handle these issues.
Who said there isn't? And who says C++ isn't the best, but if you want to do things easily and you're already using QT, then use .NET and C#
Jostick
what kind of projects can i do with c?
Talula
what kind of projects can i do with c?
printf, scanf and +/-* and maybe pow
Jostick
just hat jeje
Talula
just hat jeje
You actually can do anything in C, but depends on what you really want to do, your knowledge, your skill with C and experience...
Jostick
ok, well i want to learn more about, but when i want to find information everybody just tech you the basics
Talula
ok, well i want to learn more about, but when i want to find information everybody just tech you the basics
Because that is what you should do practically in C, don't even think about doing something complex, because it'll take you months to do something, which will take you 2 hours to do in other easier programming languages and maybe a day in C++
Jostick
oh ok, so do you recommend me c++
Talula
It depends on what you want to do, everything has it's advantages and disadvantages, if you want to write a broker, I wouldn't recommend C++ or C.
Jostick
for example if i want to build an OBS something similar
Jostick
Im new in c so sorry for my questions
Talula
Open Broadcast Software?
Jostick
yes
Talula
yes
You can use C++, you can use C# or you could use other tools that you're comfortable with
Talula
C++ will give you speed but add headache, C# will reduce the speed but make development easier...
Jostick
oh ok, so C is recommend for microchips
Talula
oh ok, so C is recommend for microchips
I don't use C with Microcontrollers either, I use C++, because these days everything uses string and C doesn't have any real string.
Jostick
yeah I see it ejej
Talula
yeah I see it ejej
ejej? What does that mean?
Jostick
jeje is like a friendly smile
Jostick
where are you from?
Talula
Talk C/C++ please.
Jostick
ok
Rberto
𝙰𝚖𝚖𝚊𝚛
Hello everyone Can i ask if there is any group like this group for Java ? Could i ask about something in Java here ?
𝙰𝚖𝚖𝚊𝚛
Are you interested?
Unfortunately, i cannot speak Spanish😢
Rberto
Anonymous
Is there any projects for C language for student level?
@𝑺𝒐𝒃𝒌𝒂
You can try qml for UI if using qtcreator. It is way easier.
I think this way would be what I need now. Later, may be taking some times to explore C# as suggested @Tazmikar. Thanks guys
Vitalii
Does it make sense to allocate memory for class fields if objects are created dynamically?
Vitalii
class A { int a; }; or class A { int *a; public: A() { a = new int; } }; // when I have int main() { A *b = new A; delete b; return 0; }
olli
Does it make sense to allocate memory for class fields if objects are created dynamically?
Generally, it depends. If your field is only used inside the class there is no need to create it dynamically. In your second example you should also define the destructor to avoid memory leaks.
Vitalii
I did not specify a destructor, because I portrayed the class purely for example
Anonymous
class A { int a; }; or class A { int *a; public: A() { a = new int; } }; // when I have int main() { A *b = new A; delete b; return 0; }
In your second case, if you dont allocate memory for the int* member field inside the constructor, memory wont be allocated for that field (as in the pointed to memory) even if the object of that class is dynamically allocated
Vitalii
So, in larger projects I still have to allocate memory for the class fields?
Anonymous
So, in larger projects I still have to allocate memory for the class fields?
If your class member fields need dynamic allocation, then you must allocate memory for them irrespective of whether objects of that class are dynamically allocated or not. Btw start using smart pointers.
Vitalii
I understand that for "a" memory won't be allocated in case if my object is dynamically allocated. The main idea of ​​my question is exactly in which cases I should allocate memory for class fields, whether it is necessary to do it.
Vitalii
or it depends..
Vitalii
Ok, thanks )
olli
I understand that for "a" memory won't be allocated in case if my object is dynamically allocated. The main idea of ​​my question is exactly in which cases I should allocate memory for class fields, whether it is necessary to do it.
to be pedantic, by creating an instance of the class you do also allocate memory for a. In fact, the second class is likely to be bigger than the first one because a pointer (int*) is probably bigger than your integer int. However, only in the first instance you do allocate / create an int by default. e.g. #include <cstdio> struct A { int a; }; struct B { int *a; }; int main() { printf("sizeof(A): %u\n", sizeof(A)); printf("sizeof(B): %u\n", sizeof(B)); return 0; } prints Program returned: 0 sizeof(A): 4 sizeof(B): 8 If your questioning whether you should have allocate a field dynamically you probably shouldn't, otherwise you would know. An example for a dynamic field is std::string, you don't know how big the string is going to be so you need to make sure you allocate enough space in the constructor, there is no way of knowing ahead of time.
Vitalii
I got it, thank you
ប៊ុត
/get
ប៊ុត
I'm sorry
Anonymous
Hye
Moura
Has anyone experienced this error? configure: error: --with-tls=yes was specified but no compatible TLS libraries could be found.