Anonymous
Anonymous
arrays are an intermediate topic here
Anonymous
i wanna learn c++
Anonymous
my bro told thats good but no need to read it completely
Anonymous
i dont wanna master c++
Anonymous
yeah but that's like 1k pages+!
Anonymous
i got quite confused when he (author) used his own libraries (nu iostream)
Anonymous
isnt the book outdated or wut?
Anonymous
.
Anonymous
i'll just go with it then
Anonymous
oh thanks :p
Serenity
Hey guys I have written some code to find a substring within a string without using custom libraries at all
Serenity
but I have found out there is a logical flaw in it
Serenity
Can somebody take a look and guide me what is wrong ?
Serenity
Ok
Serenity
int pattern_in_string(char str1[],char str2[])
{
int pattern_length, j=0, i = 0, count = 0;;
while (str1[i] != '\0')
{
while (str2[j] != '\0')
{
if (str2[j] == str1[i + j])
{
count++;
j++;
}
else
{
j = 0;
break;
}
if (j == count)
return 1;
}
i++;
}
return 0;
}
Serenity
I think my code is correct
Serenity
I didn't notice that a single char can also be considered as a substring
Serenity
and as I set in inputs i forgot it apparently
Anonymous
Anonymous
btw the gui thing's not included in the book right?
Anonymous
MᏫᎻᎯᎷᎷᎬᎠ
I didn't finish any C++ book correctly in my entire life
Anonymous
oh lul >.<
Anonymous
how's geeksforgeeks?
MᏫᎻᎯᎷᎷᎬᎠ
How much do you know about C++ or programming in general?
Anonymous
ive watched a 4 hr freecodecamp yt vid
Anonymous
you can tell ik all of these
MᏫᎻᎯᎷᎷᎬᎠ
Good
Now there are more concepts to learn
I advice you to read c++ primer
It suits you well
MᏫᎻᎯᎷᎷᎬᎠ
After that
Move from reading books to doing things
Anonymous
Anonymous
oh its a book
MᏫᎻᎯᎷᎷᎬᎠ
Yeah it's a book
MᏫᎻᎯᎷᎷᎬᎠ
:)
Anonymous
so like this book or the c++ book from the creator?
Jussi
Primer is good, I think its not written by Stroustrup
Anonymous
i meant wuts better? stroustrup's book / primer
Jussi
I guess primer is better hands-on book
Jussi
If you want to know more theory and design decisions, then you might wanna learn what Stroustrup was thinking when he made the mess called c++
Anonymous
cant buy it here rn :c
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
But
The major ones
abhi3700
https://stackoverflow.com/questions/61422781/segmentation-fault-core-dumped-error-in-boost-python-hello-world-example
abhi3700
MᏫᎻᎯᎷᎷᎬᎠ
Wow
MᏫᎻᎯᎷᎷᎬᎠ
Madhu you are awesome
Jussi
Ah, my bad. I thought it's the one that goes deeply into the design of the language itself
MᏫᎻᎯᎷᎷᎬᎠ
Teach me
MᏫᎻᎯᎷᎷᎬᎠ
I'm just an amateur
Yakov
I have good example KMP code if somebody wants
MᏫᎻᎯᎷᎷᎬᎠ
Well
It happened to be I have both discrete and algorithms books
Not the one you mentioned
MᏫᎻᎯᎷᎷᎬᎠ
But there is a good one I advice you to take
"Discrete mathematics and its application" by Kenneth H. Rosen
MᏫᎻᎯᎷᎷᎬᎠ
That's why I said one not ones ;)
MᏫᎻᎯᎷᎷᎬᎠ
I don't know if it's a dumb question
But what type of knowledge you'll get and soo useful from learning Discrete Math
MᏫᎻᎯᎷᎷᎬᎠ
My short term opinion you'll just learn a good way to reduce your if blocks in the code
Sets, graphs and trees can be taught from data structures and algorithms books
MᏫᎻᎯᎷᎷᎬᎠ
Thank you Madhu
MᏫᎻᎯᎷᎷᎬᎠ
For real
URVASHI
Anybody
URVASHI
Want help in c
Anonymous
Madhu do you work somewhere as developer or a student
Anonymous
Because you knowledge is great
Anonymous
Anonymous
That's why
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Okay
Thanks :D
Anonymous
Where to find this course is this on YouTube?
MᏫᎻᎯᎷᎷᎬᎠ
Never took an online course
Gotta try
Anonymous
MᏫᎻᎯᎷᎷᎬᎠ
The beauty when you apply some of those concepts to your daily programming problems
Sakthijs23
I agree
s