0
Difficulty in learning Array
I started c++ and i found a topic of array which is very difficult for me. I spent many time on it but i couldn't understand it tell me who i understand it
6 Respuestas
+ 1
Array
0
what you haven't understood? How the array works or what is a pointer?
0
And pointer both
0
If you are a visual learner, try watching C++ youtube tutorials by thenewboston
0
What do you know about arrays so we take it from there?
0
I've recently taken up trying to learn C++ after 20 years ago learning the basics.
To be honest, I try to avoid the whole pointer thing as much as possible, as C++ has evolved a lot over the last 25 years. I'm sure there's good reasons to use pointers etc. as I'm no expert, but it will mostly depend what you intend to make using C/C++. If you wanna make games, yeah you probably need to understand and use pointers. If you want to make desktop applications, you probably don't really need to understand them that well, only the basic idea of what they do which is: the point to the address in memory where a value is stored, and you can access the value at that memory address if you want.
I restarted recently and just jumped directly to using things like vectors, maps, etc. which are all part of the standard C++ libraries these days (C++17 and onward). You should use a data type that best fits what you want to do with your data and what your data is. I use chatgpt and ask it what data types to use and the pros and cons of each type if I decide to use them.
C arrays (pointers) and C strings are a pain in the ass IMO and i try to avoid them like the plague. (For got to say I am only trying to develop command line and desktop GUI applications!)