🙋🏻‍♂️
https://imgur.com/WnF6W87
Danya🔥
Hello guys, can someone help me for this?
By "help" you mean "do it for me"?
🙋🏻‍♂️
No
🙋🏻‍♂️
I made something, lemme write
🙋🏻‍♂️
#include <stdio.h> #include <stdlib.h> int main(){ for(int i=9;i>=1;i--){ for(int j=i;j>=1;j--){ printf("*"); } printf("\n"); } return 0; }
🙋🏻‍♂️
I made other side too but not at the same line
Кто-то
Hi, is there UB?) std::unique_ptr<leBrep> _brep = std::make_unique<IwBrep>(new(*_context)IwBrep());
Danya🔥
Danya🔥
If you intend to make zero allocations here — it doesn't happen here — make_unique allocates
Anonymous
Hi, is there UB?) std::unique_ptr<leBrep> _brep = std::make_unique<IwBrep>(new(*_context)IwBrep());
Maybe. You are using the placement form of new. So depending on how *_context is allocated, this may cause Undefined Behavior. For example if *_context is a char buffer, then this is definitely Undefined Behavior.
Anonymous
What type of *_context allowed to be?
It should be of type *lwBrep or a type derived from it as long as lwBrep has a virtual destructor
Danya🔥
Anonymous
> For example if *_context is a char buffer, then this is definitely Undefined Behavior. Not really Depends on characteristics of lwBrep
It is definitely Undefined Behavior because the char buffer can't be destroyed using a delete operation on lwBrep pointer.
Danya🔥
It is definitely Undefined Behavior because the char buffer can't be destroyed using a delete operation on lwBrep pointer.
If the buffer is the same size as the type of an object being created and if the type is trivial, it's not an UB
Anonymous
If the buffer is the same size as the type of an object being created and if the type is trivial, it's not an UB
I said am assuming that lwBrep has a virtual destructor. So it is not a trivial type by assumption
Кто-то
But it is virtual)
Danya🔥
The requirements for the type to be trivial, you can find on cppreference
Anonymous
So, is lwBrep has virtual destructor it is UB?
If it has a virtual destructor it is not trivial. It will be UB then if *_context is not of type lwBrep*
Leovan
I have some lists (markdown syntax) in str: some text * item 1 * item 2 * item 3 * item 1 * item 2 * item 3 some text I need using std::regex add signs around this list, for example: some text $ * item 1 * item 2 * item 3 $ $ * item 1 * item 2 * item 3 $ some text how to do this? I can find only items separately, but not all list. I need only right regular expression
Anele
Hello everyone!
Anele
Any tips on how I can best start learning Cpp?
Anele
I have tried reading books but they are just too complicated
Vinay
first definitions details and description ..so ur concept or dictionary will be clear
Vinay
then try to understand the single line commands and each words that relate un that program
Vinay
there are course about c++ on swayam india
Vinay
and they are very easy to understand they teach steps wise very fundamentally
Vinay
its a govt official website to provide education
Vinay
swayam included NPTEL ,CEC AND IGNOU in its course
Anele
then try to understand the single line commands and each words that relate un that program
Okay. I will definitely give all this a try. Thanks a lot for the response.
Anele
there are course about c++ on swayam india
Is it in English? If so please share the website... Thanks!!
Vinay
just ping me if need any help
Danya🔥
google swayam prabha courses
Please do not advise someone to take noname Indian courses
Danya🔥
Or actually any noname courses
paper
there are course about c++ on swayam india
If it's you first language, c will be better to start with
paper
No, it's not
There's just too much stuff to handle for one who doesn't know anything about programming
Anonymous
No, it's not
🤣🤣🤣
Danya🔥
🤣🤣🤣
What's so funny?
Danya🔥
Anonymous
What's so funny?
I was also confuse when I started python but c++ help me to see it clearly So c++ is a good start
Danya🔥
Yep
So, why are you telling me this? Read the conversation
Anonymous
So, why are you telling me this? Read the conversation
Oh sorry I read it wrong thought you said c++
Anonymous
So, why are you telling me this? Read the conversation
But hey I've been learning c++ and phython but I don't know what to do with Erm can u suggest something
paper
If the goal is to learn C++, a person should learn C++, not C
As he wishes, I just suggested to start from something easier
Vinay
Please do not advise someone to take noname Indian courses
pls dont interrupt if u didn't browse the thing by ur.own
Vinay
I'm helping the guy atleast ...or u got the better idea to teach him...then pls tell... instead of making him demotivated
Vinay
swayam is a platform to teach people c++
Vinay
with fundamental.knowledge ... I'm sorry if u didn't know about it ...u should search and see the content then
Vinay
u can thank me later
Anonymous
This is very important for programmers
Victor
BTreee
Vinay
Aren't those on TV only or something?
yaa they broadcast their content on tv also
Vinay
but taking course is better u can skip the video according to ur understanding... the course is free but they conduct exams for certification with a charge of 1000 rs
Danya🔥
u can thank me later
For what? Probably another shitty course?
Vinay
He doesn't seem like Indian so how is he supposed to get those channels?
I told him about the online courses provided by indian govt.. that also broadcast on tv for people like us
Vinay
yes the courses for all including international students
Gilded
https://telegra.ph/file/c90036db271f834d321ec.jpg how to fix this "Non-void function does not return a value" in this code?
Gilded
https://telegra.ph/file/c90036db271f834d321ec.jpg how to fix this "Non-void function does not return a value" in this code?
code #include <iostream> using namespace std; class Note { // declare a static data member static int num; public: // create static member function static int func () { cout << " The value of the num is: " << num << endl; } }; // initialize the static data member using the class name and the scope resolution operator int Note :: num = 15; int main () { // create an object of the class Note Note n; // access static member function using the object n.func(); return 0; }
Gilded
The error says exactly what you need to change
can you please clear it send what to correct pls
Ludovic 'Archivist'
https://telegra.ph/file/c90036db271f834d321ec.jpg how to fix this "Non-void function does not return a value" in this code?
Look at the function signature, in its contract, you specify that you return something but do you actually obey that contract?