Anonymous
not initialised is allowed
What does it mean?
Anonymous
An array of pointer?
lotuslwt
if initialised, its contents can't be changed, isn't?
lotuslwt
good idea, I try it...
Anonymous
guys im reading the cprimer 5th edition book , in the 2nd topic rn , types . why are even loops used here :/ when its not explained :c
lotuslwt
but have one problem, actually, a[] have many elements...
Anonymous
the bytes/words context is confusing af :c
Anonymous
i got told the 2nd chapter wouldnt have any advanced unexplained stuffs :c
Anonymous
but it does have that :c , loops/if else
Anonymous
yes im doing that
Anonymous
its just about variable and types/ why does it even have those loops stuffs :c
lotuslwt
yes, I am always confused with memory management.
Anonymous
i mean why does the chapter that claim to teach only variables even give other examples of loops which havent even been explained before :/
Anonymous
heck the first chapter even introduces classes
Anonymous
heck the first chapter even introduces classes
yes but thats like just an overview of all the chapters
Anonymous
it doesnt even tell how to add functions to a class header and tells to use it :c
Anonymous
yes but thats like just an overview of all the chapters
no. there is no separate chapter on stuff like for loops. the book expects you to have some programming knowledge
Anonymous
"even give other examples of loops which havent even been explained before"
Anonymous
oh you are right
Anonymous
:c
Anonymous
:/
red - your complaint about usage first and implementation later blue - expected background
Anonymous
oh you are right
ye but it is not exactly equivalent to C books where there are entire chapters on loop with repetitive tasks and gigantic explanations for everything
Anonymous
red - your complaint about usage first and implementation later blue - expected background
i do know most of the basics tho! but am just seeing it as a beginner's view and thats not quite good for a beginner to learn stuffs that jump straight to the complex stuffs (while teaching basic topics) without quite explaining it , like why cant teach stuffs in an order :c
Anonymous
yeah i'll just go with the creator's book then :c
you don't really have to. just read the first chapter
Anonymous
the overview?
ye Chapter 1 Getting Started
Anonymous
ye Chapter 1 Getting Started
ive read 70% of that , got stuck on the classes part and started 2nd chapter
Anonymous
ive read 70% of that , got stuck on the classes part and started 2nd chapter
:/ 70% of that includes the section "The for statement"
Anonymous
and the section "Flow of control"
Anonymous
Anonymous
or at least mention it
Anonymous
yeah its a custom header, shouldnt it explain that too :/
Anonymous
yeah its a custom header, shouldnt it explain that too :/
find the first time the header is mentioned
Anonymous
library*
Anonymous
in that chapter it didnt wys :c
Ciclonite
Why all my external link was removed
Anonymous
in that chapter it didnt wys :c
section 1.5.1 The Sales_item class what it is, how to use. Exercise 1.20 how to download
Anonymous
Why all my external link was removed
you just joined. add some spaces. www. example dot com
Ciclonite
Ok thanks 👍
Ciclonite
char* bhmac(char* data) {         unsigned char *key = SECRETKEY;       unsigned char *result;       int result_len = 32;       int i;       //static char res_hexstring[32];       char *resptr = (char*)malloc(sizeof(char)*32);       result = HMAC(EVP_sha256(), key, strlen((char *)key), data, strlen((char *)data), NULL, NULL);       for (i = 0; i < result_len; i++) {         sprintf(&(resptr[i * 2]), "%02x", result[i]);       }       return resptr;  }
Ciclonite
Can someone help with this code?
Ciclonite
There is a problem with memory allocation
Ciclonite
Too small
Ciclonite
But the for cicle stop at 32
Ciclonite
Thanks for pointing me in the right direction
Anonymous
Anonymous
Anonymous
like how hard is it to scroll
Anonymous
ive got the gcc file already
Anonymous
ive got the gcc file already
it has the Sales_item.h file in the folder named 1
Anonymous
ive got the gcc file already
btw almost every repo that posts solutions to the book includes the file, including mine https://github.com/chandradeepdey/C-_Primer_5th/blob/master/book-resources/Sales_item/Sales_item.h
Anonymous
red - your complaint about usage first and implementation later blue - expected background
btw ik all of these stuffs so like can i head over to cprimer?, stroustrup's book seems beginner friendly af , idk wut to choose :c
Anonymous
btw ik all of these stuffs so like can i head over to cprimer?, stroustrup's book seems beginner friendly af , idk wut to choose :c
that is something you need to figure out yourself. you were complaining about some things the book apparently skipped, i just pointed you to the relevant sections. C++ Primer starts discussing the while statement like this "1.4.1. The while Statement A while statement repeatedly executes a section of code so long as a given condition is true. We can use a while to write a program to sum the numbers from 1 through 10 inclusive as follows:" in my opinion, if you are expecting entire sections on writing repeating code, learning why repeating code is bad, learning how loops solve it, then learning the actual loop syntax; you should read stroustrup's book or some C book if you are not expecting that, stick to Lippman
Anonymous
Bro try A video course
i watched a freecodecamp vid , it was great
Nils
Is there some way to tell c++ to NOT include stdlib?
Nils
Everything I find on the internet is useless
Nils
(As in no effect)
Zel
Don't include any code that uses the STL in your headers or suppport libraries and do not use the STL name space
Zel
Otherwise its an auto dependency.
Nils
The problem is that I define getchar()
Nils
Does that work if I define via extern keyword?
Nils
okay.
Nils
extern char test::getchar(void); Like this?
Nils
error: ‘char test::getchar()’ should have been declared inside test :-/
Nils
oh.
Nils
Does not work since the functions are pure C
Dima
Lol
Nils
Damn I just linked a message
Dima
@K11M1 you fucked up
Nils
I have no headers yet