coal
however learning C++ only knowing python is a completely different story lmao
artemetra 🇺🇦
artemetra 🇺🇦
the thing i most felt strange about python was this syntax: mylist = [ num for num in numbers if num > 2 ]
yeah, comprehensions were weird at first but they are very handy and succinct imo :')
coal
yeah they're handy
coal
the syntax is weird but they're useful so thats good enough
coal
that's what i'm currently going through
the only difference is that C++ is way more explicit than Python
coal
the only difference is that C++ is way more explicit than Python
oh and that you're on your own for most part of the low level things
coal
as long as you have determination it shouldn't be complicated
coal
C++ is a large language with tons of features, so you don't really need to know it all to use it properly
artemetra 🇺🇦
yeah that's why i'm starting it as early as possible
coal
i wish you luck
artemetra 🇺🇦
thanks :D you too!!
Ehsan
Compiler optimises everything
Ehsan
it’s its job to save time
Anonymous
Okay😁 I learning that's why I am taking everything very serious.
Phoenix
Can we become a game developer from learning C/C++ ?
Phoenix
Becoming a gaming developer is my aim.
Anonymous
Okay😁 I learning that's why I am taking everything very serious.
You are learning it wrong. @Tazmikar's reply to you on the use of volatile variables is wrong. Using volatiles in a multithreaded read/write environment without synchronisation will lead to Undefined Behavior. If used with synchronisation, volatiles serve no more useful purpose than regular variables. The only use for volatiles is in hardware programming where things outside the scope of your program can change the variable. For ex - I would use a const volatile variable to represent the status register of a processor. This variable will be only read by my program and will not be changed. But the status register can be changed outside of your program by your processor.
Ehsan
sometimes they make a life hack were they an easily read values in memory. for example: static int something; int bruh() { something = 4 //…. some statements if (something == 4) printf(“hi bro hw r u?”) } the compiler now thinks “something” will always equal to 4 so it will make an optimization like this: static int something; int bruh() { something = 4 //…. some statements printf(“hi bro hw r u?”) } but if you use volatile, you are basically telling the compiler to check the value each time and don’t try to cut corners.
Anonymous
Umm synchronization ??
Ehsan
This is useful if you have static variables which are shared among threads, or if you are working with hardware memory directly to communicate with devices
David
I have searched all google and git hub on encrypting and decryting text specified by using a certain key.
David
but i am not really getteing what i want
Ehsan
David
because when u started coding you knew every sinlge code to write 😁😁
Ehsan
because when u started coding you knew every sinlge code to write 😁😁
Yup :) But we didn’t learn coding to solve your assignment ;(
Ehsan
why not study and become able to code?
David
Yup :) But we didn’t learn coding to solve your assignment ;(
does every code someone bring have to be assignment? I am done with college and i am learning c++ part time on my own
David
so i dont see the point of being rude instead of productive or helpful
Ehsan
lmao he blocked me
𝐄𝐲𝐚𝐝
Hi there, I love and trust this community, and I need you help! I'm studying Software Engineering, and I finished C++ (Basics and OOP only), we are studying Java now (at college). Do you recommend me finishing all C++ concepts, and studying Java for the college only, OR moving to Java?
Ehsan
C++ is not worth it in most fields
𝐄𝐲𝐚𝐝
i feel you should complete c++ totally and get comfortable with it
Great 👌, I'm comfortable with this as I think that programming is a logic, not a language(s).
David
👍
𝐄𝐲𝐚𝐝
C++ is not worth it in most fields
I'm totally with you about fields, but I think that C++ is useful to build a logic, because you have to do everything yourself, not hard as assembly, or easy as python. What do you think? is that true?
Ehsan
I'm totally with you about fields, but I think that C++ is useful to build a logic, because you have to do everything yourself, not hard as assembly, or easy as python. What do you think? is that true?
Bruh c++ is convoluted with too much features. If you want to make “everything yourself” it’s better to learn c rather than c++ because of it’s simplicity.
𝐄𝐲𝐚𝐝
Bruh c++ is convoluted with too much features. If you want to make “everything yourself” it’s better to learn c rather than c++ because of it’s simplicity.
Great, you took "everything yourself" part very seriously, I mean it's not as hard as assembly or "C" and not easy as python. I got your point. Thank you very much 💕.
Ehsan
just jump into Templates, you will scratch your head until you reach your scalp ☺️
olli
You are learning it wrong. @Tazmikar's reply to you on the use of volatile variables is wrong. Using volatiles in a multithreaded read/write environment without synchronisation will lead to Undefined Behavior. If used with synchronisation, volatiles serve no more useful purpose than regular variables. The only use for volatiles is in hardware programming where things outside the scope of your program can change the variable. For ex - I would use a const volatile variable to represent the status register of a processor. This variable will be only read by my program and will not be changed. But the status register can be changed outside of your program by your processor.
+1 [dcl.type.cv]#note-5 states [Note 5: volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. Furthermore, for some implementations, volatile might indicate that special hardware instructions are required to access the object. See [intro.execution] for detailed semantics. In general, the semantics of volatile are intended to be the same in C++ as they are in C. — end note] I would not call changes in another thread "undetectable", changes outside your program or asynchronous signal handlers however are.
Ehsan
if you want to continue I recommend you to follow books rather than tutorials @EyadJm
𝐄𝐲𝐚𝐝
if you want to continue I recommend you to follow books rather than tutorials @EyadJm
I saw this post, you are awesome for sharing this with me, thanks for your attention 💪🤝🤝
Azhar
what does not work?
I was making a reverese string with space in c
coal
amazing
coal
you're literally selling a curl request in a for loop
coal
amazing
Roxifλsz 🇱🇹
amazing
Thanks
coal
sadness
Nothing
Why the Pc has an incrementor +1
Nothing
Does anyone know
Anonymous
is there an alternative to freetuts & learningcrux?
klimi
Why the Pc has an incrementor +1
You mean program counter? Because you are reading the next instruction
Bohdan
Hi everyone. Messing around with this Kata, can't get what's wrong with my code. Can anybody help?
Bohdan
All of the animals are having a feast! Each animal is bringing one dish. There is just one rule: the dish must start and end with the same letters as the animal's name. For example, the great blue heron is bringing garlic naan and the chickadee is bringing chocolate cake. Write a function feast that takes the animal's name and dish as arguments and returns true or false to indicate whether the beast is allowed to bring the dish to the feast. Assume that beast and dish are always lowercase strings, and that each has at least two letters. beast and dish may contain hyphens and spaces, but these will not appear at the beginning or end of the string. They will not contain numerals.
Bohdan
#include <string> bool feast(std::string beast, std::string dish) { int len1 = beast.length(); int len2 = dish.length(); for(std::string::size_type i = 0; i < beast.size(); i++) { for(std::string::size_type j = 0; j < dish.size(); j++) { if(beast[0] == dish[0] && beast[len1-1]==dish[len2-1]) { return true; else return false; } } } }
Bohdan
the error message: In file included from main.cpp:6: ./solution.cpp:13:5: error: expected expression else return false; ^ 1 error generated.
Bohdan
else statement is inside of IF statement
but I've done this before!
Bohdan
w/o any problems
Golden Age Of
but I've done this before!
I just told you where I see a mistake, that's the most common
Golden Age Of
Take your ELSE RETURN FALSE out of IF , put it just after
Bohdan
I just told you where I see a mistake, that's the most common
ok, i'm just trying to figure out why it worked earlier
Bohdan
in another program
Golden Age Of
ok, i'm just trying to figure out why it worked earlier
It logically couldn't, you can't say TO DO SOMETHING ELSE when you didn't say what should be done first
Golden Age Of
Drop an example
Bohdan
Drop an example
may I send you screenshot in pm?