Anonymous
only created when provoked
Nils
https://hastebin.com/itiyusamam.cpp
Hi, what is the reason for line 17 to segfault? I am getting no warning or error in compiler…
Nils
ohhh nvm I found it right after posting the question
Nils
I'm so stupid sometimes
Anonymous
why u using struct enums
Anonymous
??
Nils
Can I compare a std::string with a std::string_view, is that any problematic?
Anonymous
Anonymous
Anonymous
Anonymous
https://www.educative.io/edpresso/what-is-the-cpp-string-view-in-cpp-17
Anonymous
Anonymous
remain unchanged
Anonymous
Beacuse I didnt want to type
they knew what std::string_view is. their question was whether operator==(std::string_view &, std::string &) would work. obviously it will. the string will get converted to string_view
Anonymous
What is the purpose of struct enums union??
Anonymous
If we still have classes??
Nils
Nils
and debugability
Nils
In my experience enums are displayed correctly while that what you are talking about are not.
Nils
Can std::string be overflowed?
Francisco
What is the purpose of struct enums union??
Structs are different from classes in a conceptual way, but in practice, you can use both for the same purpose. Enums are just syntactic sugar for types you only want to have specific values (for example, a direction can only be up, right, down and left). Unions are completely different. They are meant for types whose attributes share the memory
Ariana
Can std::string be overflowed?
https://stackoverflow.com/questions/10398144/does-buffer-overflow-happen-in-c-strings
generally from experience c++ pwning is significantly harder tho
Nils
I think I somehow managed to overflow it…
Nils
Just by pushing random data in
Nils
I notice the overflow because one of my bools has a value of 3 afterwards.
Nils
Just overflowing with \0 seems to not have that effect
Nils
Nils
Wait, I can send the problematic code…
Nils
Nils
https://hastebin.com/nejonofohe.cpp can you see anything wrong?
Nils
Anonymous
Who has a resource on how to learn C with Visual studio
Asdew
Who has a resource on how to learn C with Visual studio
The University of Helsinki and Aalto University have created a MOOC course together, I have not tried it, but I've heard the Java MOOC course by the University of Helsinki is excellent.
https://moocfi.github.io/courses/2016/aalto-c/en/
#свободуНавальному
Hello. Why c compiller (gcc) compile it, but c++ (g++) no?
I wanna use c files inside c++ without changes. It is possible?
p.s. This example just show the problem, therefore don't suggest fix c code if it not critical warning in c and need only for work this in c++ "extern".
#свободуНавальному
#свободуНавальному
Dima
Anonymous
I'm writing a while loop, that should show to the user some kind of menu, where the user can type his choice, or 'enter' to use the default option. In order to do so I'm using an fgets function, and I would like to clear the buffer after that, in order to not compromise the further selections.
If I use something based on getchar() my program enter in some kind of loop and stops working right after the fgets
Here is a sample of my code https://pad.riseup.net/p/-skZv-GPDMwV1oJAYUGU-tmp
Anonymous
Hi to everyone ;)
Nils
Can I enable optimisations and debug at the same time?
TalkSick
Anonymous
I'm a newbie and I'm learning C on my own, probably there are some coding horros 😂
Surya
Guys I am confused in reading these fat16 filesystem directory entries. The directory structure provided on internet is too direct to fit with this. Help.
Anonymous
the line I'm talking about is the number 70
Anonymous
Mandelbröt
Any way to concatenate a string k times (k<=10^18)
Its giving tle ...(in c++)
Anonymous
Use gnu readline or any operating system specific extension
Anonymous
Fgets only when you actually read from a file
Anonymous
thanks
Anonymous
[In reply to Cooooooooooom'); DROP TABLE ALL; GNU/Yuki Nagato జ్ఞాజ్ఞాజ్ఞాజ్ఞ (長門有希) XDA: @anupritaisno1 @glassrom I use Arch btw జ్ఞాజ్ఞాజ్ఞ]
then, how can I write a program that behave, for example, like fdisk? It shows to you the default option, but lets you to use a custom one. I'd like to do that
Anonymous
Anonymous
I know what it is just thinking about it
Anonymous
It's just an example, I'm talking about the gnu utility that manages partitions
Anonymous
Anonymous
parsing arguments isn't hard
Anonymous
even for beginners
Anonymous
the actual work of fdisk might not be for beginners
Anonymous
I think It's too hard for me.. it doesn't matter, I'll find a solution in the future when I'll be more experienced. Anyway I obtained what I expected, the problem is that sometimes, the second choicebis being altered by the buffer. Sorry for my bad English
Anonymous
Std::vector<int> snail(std::vector<std::vector<int>> snail_map)
{
//code or no code shows the same thing
}
Int main()
{
Snail({{1, 2, 3}, {4, 5, 6}}):
}
This is showing
"Double free or corruption (out)"
Why? And how to solve thus
Anonymous
Wut the problem its a vector inside a vector
Nils
Anonymous
No its the part of a question
Anonymous
I didnt write any if my code and its showing me the error
#свободуНавальному
Hello. Why c compiller (gcc) compile it, but c++ (g++) no?
I wanna use c files inside c++ without changes. It is possible?
p.s. This example just show the problem, therefore don't suggest fix c code if it not critical warning in c and need only for work this in c++ "extern".
Anonymous
Anonymous
Why do u wana use c code inside c++?
#свободуНавальному
For split libs on c and c++
I should use c libs inside c++
Anonymous
Hello
Anonymous
How to reboot android with c program.
Anonymous
I use c4droid.
Anonymous
Surya
Anyone can help with filesystem?
Anonymous
Does someone have a tool for windows which shows the hirarcy of h files?
Chernykh