Lyroy
I've been using SDL2 (for games) for a bit now and it does it's job pretty well but I've never liked the fact that it's not object oriented (because of it's C nature) and so you have to manage every single bit of memory you use. Tired of this I've stumbled upon SFML, and it looks pretty solid. I would like to know what you think about SFML.
Pavel
how do solve intellisense indentifier string is undefined in class added in gui
Do you have #include <string>? What IDE you use?
MuchubaTactics
What's a way of accepting user input directly into a pointer, specifically a string, in c
MuchubaTactics
??
G
is it possible for a .dll to accept stdin entries through an export function? ex: rundll32 file.dll,alert
Nhamo
Thanks
Adaita (MedTech | Healthcare)
Dear admins. There is a telegram group for Qt cross-platform application development framework. As this framework is primarily based on C++, I would like the experienced people who are actively working on Qt to join the group to share knowledge and answer questions of the group members. I would like to ask the admins whether do I have permission to share the group link here?
21BCS10133_Prashant
Can anyone suugest resources to learn c++ as I am a begginer
Anonymous
Bro how to add image in imgui
Pavel
Bro how to add image in imgui
Here, I googled this for you https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
Pavel
Bro tried not working
You don't provide enough info to help you. What is not working? What exactly did you do? What was the expected behavior, and what was the outcome? What else you tried to solve this?
Anonymous
Input string ab2c4hj3 Output string abbbccccchjjjj
Anonymous
I can't able to make logic of this.
Anonymous
Can someone help me please ..
'''''''
Input string ab2c4hj3 Output string abbbccccchjjjj
Once u come across a number n, push back the last character u came across n times again
'''''''
Parse the string If u land on a character, push back the character to the resultant string If u land on a number n, push back the previous character n times to the resultant string
Anonymous
It doesn't work, the program stops at the getline() until the child has terminated
It works perfectly fine for me. Do you flush the buffer in the child process after writing to it? If you don't then it would explain the behavior you are experiencing. If you want to see output from the child process as and when it happens, the child process should be flushing the output buffer after every output.
Anonymous
how can i send array of object as argument with friend function or normal function
Pavel
how can i send array of object as argument with friend function or normal function
C array? You can pass it as pointer to the first element and the size as two arguments. Or if you use C++ you can use std::array of std::vector and pass them by reference or const reference.
Alireza
How can I use pdf file in c++, does it have a special library?
Pavel
in c++
In C++ there are more options but it all depends on what you're doing and what version of the standard you're using. std::vector and std::array are usually the best options to implement your arrays, because they are simple and safe.
Ludovic 'Archivist'
in c++
You have to determine what exactly you need: do you need something dynamic in size? If yes you probably want to use std::vector If no, are you manipulating numeric types? If no, std::array is what you need If yes, does your array represent a mathematical vector? If yes, std::valarray may be what you are looking for, check the refs to see if it fits your usecase If no, std::array it is
/
Hi
/
should i use free() in c++ to delete a pointer
习近平我肏你妈
Only if the storage that pointer points to is allocated using malloc()
习近平我肏你妈
Then it's just UB.
/
Then it's just UB.
audio_data = new int16_t [ samplesCount ];
/
so how i delete this
习近平我肏你妈
Storage made by new[] should be (destruct and deallocate)-ed with delete[]
pavel
delete [] ( audio_data )
delete[] audio_data;
pavel
Brackets
习近平我肏你妈
Semantically nothing. Choose what you like.
/
Brackets
yes but nothing chanhes
习近平我肏你妈
How the lifetime of an object ends must be paired with how the lifetime of an object begins. At least for C++. In C the wording and the result semantics might be a bit different.
习近平我肏你妈
Things done in new/new[] must be finished using delete/delete[], and free() is only supposed to finish what is done in malloc()
Anonymous
C array? You can pass it as pointer to the first element and the size as two arguments. Or if you use C++ you can use std::array of std::vector and pass them by reference or const reference.
class_a *ptr[5]; class_b b[5]; for (int i=0;i<5;i++){ b[i].title="c++"; b[i].edtion="jake"; b[i].num=1048;} //ptr=&b; for (int i=0;i<5;i++){ ptr[i]=&b[i]; search (std::vector<class_b>book , "jake"); search is friend fun. don't Run have error
Pavel
i will try many thank my brother 🥀🥀🥀🥀
What kind of function you want to call and what you want to do with it? Can you provide more info?
/
i have another question
/
if i create the buffer with mmap
/
buffer = (char *) mmap(NULL, fileSize, PROT_READ, MAP_PRIVATE, descriptor, 0);
/
how i delete it
Pavel
how i delete it
Calling munmap? https://man7.org/linux/man-pages/man2/mmap.2.html
Pavel
why its a question
Because I don't know for sure
Pavel
can i send photo in private ??
No please, you can copy your code to pastebin and share it here
Pavel
error namspace std has no member array
Add #include <array>
Anonymous
What kind of function you want to call and what you want to do with it? Can you provide more info?
ok array of object friend function to search a title book in array of object found or not in main fun. only invoke friend fun. loop and cout been in friend function
Pavel
ok array of object friend function to search a title book in array of object found or not in main fun. only invoke friend fun. loop and cout been in friend function
Should it be able to search in an array only of specific size? Should your arrays be dynamic (so you can add/remove elements at runtime) or static (fixed size)?
Pavel
Is it a homework/assignment? Because if yes, they may expect you to do something very specific (and not necessarily something you would do in real code)
Pavel
assignment
Well, then they probably expect you to pass a pointer and the array size. But in C++ code it usually an uncommon case (e.g. if you integrate your code with some C or legacy code). Give me a sec
Anonymous
Hello my name is Bemigho and I am new to c++. I have been having a hard time understanding pointers and reference. Does anybody know any YouTube channel or a course that can explain it better to me
Thadeu
Hello my name is Bemigho and I am new to c++. I have been having a hard time understanding pointers and reference. Does anybody know any YouTube channel or a course that can explain it better to me
there is a book directed to C. It is precious on explanations of arrays and pointers named Expert C Programming from Peter van der Linden. It is not difficult to find it in the web. It is from 1994, but still very relevant.
Anonymous
Thank you
Муртазо
#include <stdio.h> int main() { char seven='7'; printf(typeof(seven)); return 0; } Hello guys. How have you been. Here I am trying to print the type of variable. However I can't. What is wrong with the code? Can you help me. Thank you beforehand.
/
Hi