2020-05-15 16:21:44

If you need to pass it by reference you can't and will need to create a variable, then pass a pointer. If you just want to pass it by value, myFunction(MyClass()) is what you want.

There is a new keyword but it returns a pointer and you have to store that pointer somewhere and use delete on it.

Please, please do us all a favor and find a C++ tutorial and read it though.  This is covered in literally every C++ tutorial/book I have ever seen.  I try to be helpful but I don't really have the bandwidth to answer basic questions in detail right now.  Maybe someone else does, but getting us to re-explain language basics is time-consuming.  But either way, unless you start asking things that can't be answered via Google in a few minutes, I'm done.

My Blog
Twitter: @camlorn38

2020-05-15 17:38:18 (edited by amerikranian 2020-05-15 17:39:53)

Look at this website. It literally has everything you need to know.
www.learncpp.com
If I can find the equivalent for C, that would be great.

Thumbs up

2020-05-15 18:39:31

@27
You can't find the equivalent for C because you already know at least 90% of C because C is a tiny, tiny language and there's just not that much to say.  Believe it or not.

C feels like more because getting anything done in C at all takes 10 times as much code than if you'd used anything else (literally, not exaggerating).

C++ is much, much bigger.

My Blog
Twitter: @camlorn38

2020-05-15 18:41:17

Thank you for the website Americranian. I will see it.

“If you are not united,” Jamuka said in a low voice, “you can be broken by those of no importance, just like a single arrow. If you unite, you will be as solid as the five arrows and no person will break you.”

2020-05-15 18:44:10

Camlorn, believe me, I am searching in Google but I dont know the names of the problems I need to solve.

“If you are not united,” Jamuka said in a low voice, “you can be broken by those of no importance, just like a single arrow. If you unite, you will be as solid as the five arrows and no person will break you.”

2020-05-15 20:20:53

You need to fully read a book and/or tutorial on C++ so that you know that, not try to shortcut it by getting the bare minimum from audiogames.net in the hope that it will somehow be enough.

My Blog
Twitter: @camlorn38

2020-05-15 21:42:04

I guess you are right

“If you are not united,” Jamuka said in a low voice, “you can be broken by those of no importance, just like a single arrow. If you unite, you will be as solid as the five arrows and no person will break you.”

2020-05-15 22:14:15 (edited by amerikranian 2020-05-15 22:16:01)

@camlorn, I see. Still, it has been interesting and fun in places to work without all the things that you would normally expect from a language.  I enjoy it, even though it makes me pull out my hair time to time.

Thumbs up

2020-05-16 20:50:03

I am terribly sorry for the ignorance I have shown in my previous posts. I was very scared that I won't manage to finish the project, after rushing through it (I have hard-coded all the locations) I began studying C++ more indepth, because it's better to know C++ than not to know C++, and who will force me to use it? Knowledge never hurts. I find this language very clunky and weird to use, but what's like such for me, can be the best beauty for others so I'll stop now.

“If you are not united,” Jamuka said in a low voice, “you can be broken by those of no importance, just like a single arrow. If you unite, you will be as solid as the five arrows and no person will break you.”