🔥 Hillary
Hi everybody. Im having an issue with my tg chat friend's Coronavirus illness, which begins with 'C'. Do you know any medicines? Im trying to give him onion.. which doesnt work.
Dima
lol that name
Dima
haha
Dima
*Dukem Nukem’s voice* time to ban
Dima
damm where’s ID
Dima
/ban Jackson join our ban group to invest
Zel
You should be scanning the text file and pulling the data you need and the returning it
Zel
Malloc ing it into a buffer just gives you a copy of it in memory
Dima
yes but don’t forget to free after
Zel
Or you can have the memory leak
Zel
Eitherway you should be using iostream functions to extract the data
Zel
Pointers do not free data made with malloc
Dima
yes
Dima
you need to release it
Zel
Malloc is literally "Hey reserve this space for me."
Zel
The char is a pionter defining the address that is given from the malloc request. The allocated memory is the next avilible continuous amount of memory of that size.
Zel
So right now if you call that pionter it will return the address of that memory block and state that the contents are a charator array
Zel
The memorry block is a separte entity
Asdew
I'd recommend explaining stack and heap.
Zel
Google stack and heap, I cannot say where exactly the data will be physically stored becuase the stack and heap are both dynamic entities. As memory is reserved and released they change
Dima
on a heap
Zel
This
Chetan
👍
Dima
yes, but its not threadsafe
Zel
Seriuosly you just need to research how stack and heap both work, ld also advise Smart pointers as a topic if research
Dima
no
Dima
but you can kinda.. make it
Zel
Is a C++ feature, you cant use them in C but the concepts explain how pointers work and how they can be automated
Dima
yes
Anonymous
yes
Bad
Mar!o
#startteachingrust
Mar!o
#start-teaching-rust
Dima
Anonymous
yes
https://youtu.be/YnWhqhNdYyk
Dima
Nah
manas
For the basics it doesn't matter, because they're literally the same.. in fact most of C is present in C++. The main thing you should focus on is getting a good book for learning.
Asdew
https://youtu.be/YnWhqhNdYyk
This was taken out of context.
manas
I don't know all C books, but usually the ones by the language authors themselves are the best ones
Asdew
Wat
That talk was to make people stop teaching C first to teach C++.
Anonymous
This talk is about why teaching / learning C++ is better than C
Asdew
Have you watced it?
manas
Although if you're a complete beginner, I recommend Python 😂
Asdew
I did
Wasn't it about how teaching C to student learning C++ is bad?
manas
If you know pointers already then you should use The C Programming Language
manas
Don't do everything at once honestly
Yakov
Hey guys. Trying to write two-way two-phase recursive Mergesort in C++, that is the function that I use to merge my array into pairs, groups of 4, 8 and on and on. When I try to manually run it using arg step = 2 (given input is array of 8 ints sorted in pairs) I have scary warning about memory and stuff. Basically what I want is input = [44; 94; 18; 55; 6; 12; 42; 67] returned output = [6; 12; 44; 94; 18; 42; 55; 67] Can somebody help, please? I'm using Xcode
Yakov
Code
Yakov
And error, 3_Recursion is name of the file
manas
Just getting the basics right will take a lot of time, then you'll actually have to spend time practicing writing small programs in order to be able to think in code. Instead, learn the basics quickly, learn to think and write in code and then learn computer architecture
Anonymous
which computer architecture tho lol. Or do you mean the basic von-neumann architecture
manas
which computer architecture tho lol. Or do you mean the basic von-neumann architecture
Lol. I mean the subject of computer architecture and how stuff works at low level.
manas
That's good
Anonymous
Low-level programming is in my opinion one of the most interesting subjects
klimi
Anonymous
^You can fall into a pitfall that way
Anonymous
C has a lot of UB
manas
Low-level programming is in my opinion one of the most interesting subjects
It is but not if your primary goal is to learn to program and also learn low level stuff alongside
manas
Exactly. I would say you should learn from the C programming language by Ritchie. Ritchie created C. He knows what's up
manas
Yeah
manas
Initially it should be coding
manas
Although you haven't really told what all stuff you already know
manas
There's no need...
manas
Seriously... That's how you learn coding. Everything else can come later
Anonymous
or use a reference. I mostly use a reference except for obvious format specifiers like %d
manas
Yeah that's true. Some of it, you have to remember. But don't try to memorize. Remember through practice. Use docs/books/references whenever you forget, like @Remavas said.
manas
yeah pretty much
manas
Initially you can use competitive coding websites to practice. They have programs by increasing difficulty.
Asad
hello friends. sf::Text menu[MAX_NUMBER_OF_ITEMS]; menu[0].setFont(font); menu[0].setColor(sf::Color::Red); menu[0].setString("Play"); menu[0].setPosition(sf::Vector2f(width / 2, height / (MAX_NUMBER_OF_ITEMS + 1) * 1)); that menu[o].setColor(sf::Color::Red); is giving me an error. it says "the function was declared deprecated". please, help. I am using SFML for GUI
manas
There are many websites and each websites has many topics, including simply practicing a language, algorithms, mathematics, etc
manas
I'm a student 😆
manas
You can trust me on this. The most important thing a beginner needs to do is to learn to think in code. The best way to do it is through practice.
manas
Haven't really decided. I know web stuff. But I also have a lot of interest in C++, Rust and Go
manas
Nice!