W
Contracts are removed from C++20 after todays voting.
Stephanos
Jope, but they werent ready yet
klimi
Wojciech Razik: True. But we had something. There was a proposal that kind of cuts contracts a little bit: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1607r0.pdf
W
source?
DM from ISO member. But there will be one more voting on Saturday (I'm not sure how voting process looks like...)
Andrea
tnx
Badugar
Contracts are removed from C++20 after todays voting.
What are contracts exactly ? I only know contracts from Solaris/illumos
Rohan
Can anyone here tell me How to write a c program that read values from user in GUI not on terminal/console? Please share source code if you know.... 🙏🏼
klimi
yeah
klimi
you make an ui
Rohan
Tell me how?
kλletaa
you take some answer from SO
kλletaa
and then jam it in your shitty ide
Rohan
SO
kλletaa
SO
stackoverflow
Rohan
Oh!k
Rohan
I'll try
Rohan
Thank you so much
Badugar
Use an UI-designer to create a basic window with an input field, and use that for your program.
Rohan
Oh!k
Badugar
I'm not sure about Qt, because afaik it's mainly written in C++, not C.
klimi
Thank you so much
its hard tbh
klimi
i cant do qt
klimi
opengl
klimi
good luck lol
Rohan
Windows gui
klimi
just for gui
klimi
Windows gui
winforms
professor
hey guys , do you use fuzzers to test your programs?
Badugar
opengl
That was only for graphics but not for UI, right ?
klimi
you can do whatever in opengl
klimi
opengl is gpu API
klimi
like
klimi
talking to gpu
klimi
like
Вова Вист
klimi
take this data
klimi
and
klimi
display it
Rohan
And one more question???
Rohan
This is for next time
Anonymous
Ho
Nassrullah
#cppbook
Anonymous
Hlo everyone
Roxifλsz 🇱🇹
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html
Ghoul
/get cppbook
Ghoul
/get best-book
Ghoul
/get ide
Ghoul
/get findproject
Shubham
Here what is that value of a that is printed? a is a pointer and it's address is &a but k don't know why that value is printed for "a"
Shubham
Vladimir
a - random garbage from memory.
Shubham
a - random garbage from memory.
Memory of what exactly? Pointer a is assigned in the memory If I write &a I ll get where it's assigned but what is just "a"?..It needs to point somewhere and I didn't declare where to.. does "a" hold a garbage value in it?
Mihail
Which you likely can't even read
Vladimir
When you write int *a; program allocates space for pointer to int. (on stack) 'Allocates' means "Hey guy, here's address of memory you can use to store your value, but I don't know what's there now. Please initialize it before using if you want reasonable results.". This is &a. a - is random value what's left in this portion of memory from previous usages. For example: a is 8 bytes. Let's assume there was a string "hellowor". Every character in this string - is just a number. 8 number in row combines to one big number. Addresses usually displayed in hex, so we convert our 8-number value to hex representation. And that is what you see on your screenshot.
Vladimir
Of course you can try and dereference it, but I'm pretty sure you will get segmentation fault error. May be it points somewhere, but it's totally random where.
Shubham
@mmihov @suisei_v Got it! Thanks!
Anonymous
/get
Anonymous
How to make strtok (string tokenizer) (from cstring) work for c++ strings? It works for char str[] = "Hello, world!"; char* p = strtok(str, ', '); // p will point to "Hello" and not for string str = "Hello, world!"
Anonymous
I found a way using stringstream
Yash
/saved
Anonymous
/get ide
András
How to delete element from vector?
Oleksandr
🌚 .erase(ass);
András
🌚 .erase(ass);
But it will decrease size of vector, and I don't want to do it
Oleksandr
delete without decreas?
Oleksandr
call descturtor for 'ass'
Mihail
But it will decrease size of vector, and I don't want to do it
If you want to remove an element, but keep the capacity the same, you can either replace it with an arbitrary value, but that won't actually remove it or you can remove it and reserve the capacity the vector had prior to removing it
Oleksandr
erase doesn't change capacity
Oleksandr
erase call destructor and size--;