Nur
Should I start OOP first?
Anonymous
Should I start OOP first?
if by OOP you mean inheritance and virtual functions, then no. first learn about classes in depth and figure out what RAII is. then do what you were doing, learn the free store.
Anonymous
Classes are part of OOPS
yes. but they aren't something radical like inheritance.
Pavel
Should I start OOP first?
Well, I would suggest to continue your course if you feel you like it, but to take into account that the things you're learning about manual new/delete are kind of low-level way of doing things (yes, it's still used sometimes, but not in day-to-day code). So when you practice writing your own applications, try to use std::unique_ptr/std::shared_ptr instead of doing manual new/delete, and std::vector/std::array instead of raw arrays.
Lieutenant
can someone help me with my implementation of blowfish encryption algorithm?
Lieutenant
I have been trying to get it to work since a week now.
Lieutenant
https://app.blackhole.run/#7a08dde7bf196mFpwehd4qLyKv12nKPiWc2AEiHv9SVK
Lieutenant
this is the complete source code
Lieutenant
the problem is, the output of encryption and decryption is not the same. even though I have tried to adhere to the algorithm as strictly as possible
Lieutenant
any help in identifying possible bugs is appreciated x(
itsmanjeet
I am tring to return 'this' from function for a class like: class Data { string data1, data2, data3; Data* up_d1(string d1) { this->data1 = d1; return this } . . . }; so that i can use it like this d = new Data(); d->up_d1("data1")->up_d2("data2")->up_d3("data3);
itsmanjeet
is it save to do ??, any other better or sage way ??
Anonymous
Anyone knows opamp, transistors? I have 2 easy questions. I tried but I couldn't. can someone who knows write to me or from here?
Pavel
I am tring to return 'this' from function for a class like: class Data { string data1, data2, data3; Data* up_d1(string d1) { this->data1 = d1; return this } . . . }; so that i can use it like this d = new Data(); d->up_d1("data1")->up_d2("data2")->up_d3("data3);
It's safe as far as I know (but I would return a reference, not a pointer, to state that it can't be nullptr). The only caveat I know that if you will use this so called "chaining" with a standard earlier than C++17 then you need to be aware that order of evaluation of arguments is not specified there and this can produce UB in some cases. One example: https://stackoverflow.com/questions/37252328/c-execution-order-in-method-chaining
itsmanjeet
👍 ok
Javi
Do your own homework
Javi
No, you are asking somebody to do it for you. If you become a programmer who will you ask?
Dima
just like you should do now
Javi
just like you should do now
What should I google?
Dima
What should I google?
“how do I do X in %language%”
Dima
Javi
I'm not asking anybody for anything. I think you are replying to the wrong person
Javi
🙊
Dima
yes, that message was addressed to him:)
MᏫᎻᎯᎷᎷᎬᎠ
What should I google?
Do you mean the right query to google?
Javi
Again, reply to the right person
MᏫᎻᎯᎷᎷᎬᎠ
Sorry I just jumped in my bad
Javi
😁😁
Brow
Thanks for allowing me to join this group
Brow
I am a newbie who want to learn C++
Lieutenant
I am a newbie who want to learn C++
pickup a book, choose an IDE/Text editor, get started :)
Lieutenant
ask any doubts here
Brow
I have installed g++, geany and Vim on my environment. Any advice for me ?
Brow
I would like to learn C++ for cybersecurity
Anmol
What should I google?
If you do not know what to google, then you probably won't succeed as a programmer😂😂
Dima
I already did. I am not the one asking
lol you took all the fire on you
Javi
Did you try actually studying and not expecting to find the solution in internet?
Dima
haha
Nikk
haha
Will you unban me from c/c++ ot
Javi
lol you took all the fire on you
Yes. I don't want to think what would happen if I actually asked something 😂
Dima
Will you unban me from c/c++ ot
I thought you are banned here
Anmol
I already did. I am not the one asking
Ohh, sorry lol😂😂 I just saw "what should I google"😂
Nikk
I post sticker and I got automatically got kicked
Javi
No you didn't
Javi
Because nobody who tried would ask like you. What code have you written? I bet none
Javi
In your class notes
Anonymous
What IDE would you reccomend me for c/c++?
Asdew
None, just a text editor (Vim).
Dima
None, just a text editor (Vim).
I hope this is a pure sarcasm
Anonymous
I prefer ed
Lieutenant
What IDE would you reccomend me for c/c++?
geany or codeblocks works for beginners
Anonymous
geany or codeblocks works for beginners
What if I'm not a complete beginner?
Lieutenant
use gcc then
Anonymous
Nils
int max_of_four(int a, int b, int c, int d) { int maxval = INT_MIN; int values[4] = {a, b, c, d}; for (int it = 0; it != sizeof(values); it++) { if (values[it] > maxval) { maxval = values[it]; } } return maxval; } Hi, any idea what's wrong?
M.Ridvan
What IDE would you reccomend me for c/c++?
I prefer to use Visual Studio Code. You can also use different languages to code in this editor. Note that you need compiler separately.
Nils
What does it say?
2136567800 With a=3 b=4 c=6 d=5
Nils
I expect it to say 6
Javi
What's the value of INT_MIN?
Anonymous
2136567800 With a=3 b=4 c=6 d=5
Try to use sizeof(values)-1 instead of sizeof(values)
Anonymous
Nils
Ah, sizeof() is broken…
Anonymous
Nils
Oh cool ahahha
Yayy... Wasn't hard as I have experience anyways but fun :D
Nils
Thx