Ludovic 'Archivist'
+1
This is the first lesson I give when giving programming courses
Mat
Well, that's not the point
Mat
Really, try to do step by step
Mat
Which programming languages do you know?
Mat
If someone has similar interests, he will search someone capable of doing it :/
Mat
That's what i'm saying
BinaryByter
My program wasn't a hello world
BinaryByter
it was a "hallo welt"
BinaryByter
yea
BinaryByter
6
BinaryByter
I think
Ludovic 'Archivist'
making it with a longer string doesn't change the concept and things you learn from it
BinaryByter
yea
BinaryByter
I was 9
BinaryByter
I started with an antiquated C++ and DevC++
BinaryByter
something like that
BinaryByter
It is just plain useless
Ludovic 'Archivist'
save them in an array of char* for each line and use a loop to print it all
BinaryByter
Marie
save them in an array of char* for each line and use a loop to print it all
save them in aa vector of std::string* for each line and use a loop to print it all
BinaryByter
he is in C
Not an excuse for not using good programmign practices
BinaryByter
this was just a joke, ignore it please
Ludovic 'Archivist'
BinaryByter
I implied that he should change to C++
BinaryByter
I think I did
Zero
i tell you hack ms, tyep ping microsoft.com to hack ms
U know meaning of my name? I guess u wanna do a Google search
BinaryByter
learn c++ first
Anonymous
s/n array of char*/a vector of std::string
this is shit programming practice
Anonymous
like SUPER shit
BinaryByter
this is shit programming practice
vector<string> over char**?
BinaryByter
no its not
Anonymous
string should not be used if possible
BinaryByter
lol
Anonymous
it is a poorly designed binding for char* at best
Anonymous
takes too much extra space
Anonymous
it takes too much extra space
BinaryByter
takes too much extra space
helps you avoid memory leaks
Anonymous
helps you avoid memory leaks
only fucking retards have memory leaks
BinaryByter
it has many utilities
Anonymous
you should minimize the dynamic allocations till you absolutely need them
BinaryByter
C++ isn't C with something added
Ludovic 'Archivist'
string should not be used if possible
it should not for immutable suff, for mutable, it is good
Anonymous
and whenever you write a create
Ludovic 'Archivist'
For immutable, string_view should be used
Ludovic 'Archivist'
BinaryByter
where is string_view located btw?
Ludovic 'Archivist'
BinaryByter
Anonymous
char* are far worse
no they are not
Ludovic 'Archivist'
no they are not
suuuure, strlen is so fast
BinaryByter
you can use most C code in C++. but you shouldn't
Anonymous
suuuure, strlen is so fast
or you can do something smarter and use special arrays
Ludovic 'Archivist'
concatenation or printing of char* require strlen dude
Anonymous
where you reserve 8 bytes before it
Marie
concatenation or printing of char* require strlen dude
concatenation or printing of char* require strlen dude
Anonymous
and then you have that as the length of the array
Ludovic 'Archivist'
where you reserve 8 bytes before it
which does the same as std::string
BinaryByter
not for a beginners
Anonymous
it is not
BinaryByter
Anonymous
because std::string has MORE
Anonymous
std::string has function definitions
Ludovic 'Archivist'
because std::string has MORE
it has 8 more (on 64bit) for capacity
BinaryByter
because std::string has MORE
the functions of a class aren't always stored again when you use the same class twice
Anonymous
which add to the space allocated to an std::String
Ludovic 'Archivist'
std::string has function definitions
which take nothing, they are not even in vtables