/
Yes. String
But if I want to call a function with only one parameter I have not to pass also the size right?
/
Yes. String
I have asked to my friend he said it is used to call a go function from c++
Daulet
But if I want to call a function with only one parameter I have not to pass also the size right?
Yes. But i dont know what happend after. Maybe bug, because function doesnt know string size(where '\0' character)
Daulet
Yes it's true.
But you need to know where is located that function(address)
Daulet
Thank you
You're welcome =)
Ludovic 'Archivist'
Hey people, I am working on a framework and here is an anonymous survey about what containers and data structures you use regularly as a developer. I would really appreciate every answer :) https://cloud.nekoit.xyz/apps/forms/wjDndPnLtNHeryqb
Pavel
Do you have it as a list? can't copy from that page
Ludovic 'Archivist'
Do you have it as a list? can't copy from that page
https://cloud.nekoit.xyz/s/Qf3bACrBEa62Aj9
Sid
Can we change references? In cpp
Sid
If not then how the what happened when we call by reference in range based for loop
Sid
Any one plz describe
Anonymous
Can we change references? In cpp
When you change a reference, it is the referenced value that gets changed. You can't change a reference to make it refer to some other variable after it is initialized once. As for a reference in a range-for loop, every iteration creates a new reference. Ex: for(auto& e: vec){...} Here the reference e is a new reference that is created and initialized everytime during each iteration.
Sid
Got it
Tran
Can C++ be used for backend...
Harvey
Yes
How ?
Pavel
How ?
https://www.reddit.com/r/cpp/comments/afh0mo/c_backend_service_framework/
klimi
How ?
You write the backend in c++, it's not a complete question.
Anonymous
Why is it mandatory to make a default constructor in C++??
klimi
Why is it mandatory to make a default constructor in C++??
I don't think that it is mandatory in c++...
Anonymous
#include<iostream> using namespace std; class BankDeposit{ int principal; int years; float interestRate; float returnValue; public: BankDeposit(){} BankDeposit(int p, int y, float r); // r can be a value like 0.04 BankDeposit(int p, int y, int r); // r can be a value like 14 void show(); }; BankDeposit :: BankDeposit(int p, int y, float r) { principal = p; years = y; interestRate = r; returnValue = principal; for (int i = 0; i < y; i++) { returnValue = returnValue * (1+interestRate); } } BankDeposit :: BankDeposit(int p, int y, int r) { principal = p; years = y; interestRate = float(r)/100; returnValue = principal; for (int i = 0; i < y; i++) { returnValue = returnValue * (1+interestRate); } } void BankDeposit :: show(){ cout<<endl<<"Principal amount was "<<principal << ". Return value after "<<years << " years is "<<returnValue<<endl; } int main(){ BankDeposit bd3; int p, y; float r; int R; cout<<"Enter the value of p y and r"<<endl; cin>>p>>y>>r; BankDeposit bd1 = BankDeposit(p, y, r); bd1.show(); cout<<"Enter the value of p y and R"<<endl; cin>>p>>y>>R; BankDeposit bd2 = BankDeposit(p, y, R); bd2.show(); return 0; }
Anonymous
line no.9
Anonymous
I think i am not able to explain what does it mean?
feltz sinatra
Hi there, does anyone mind explaining what the quote (') here means? int Var = 0b10111100'10111100
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Pavel
#include<iostream> using namespace std; class BankDeposit{ int principal; int years; float interestRate; float returnValue; public: BankDeposit(){} BankDeposit(int p, int y, float r); // r can be a value like 0.04 BankDeposit(int p, int y, int r); // r can be a value like 14 void show(); }; BankDeposit :: BankDeposit(int p, int y, float r) { principal = p; years = y; interestRate = r; returnValue = principal; for (int i = 0; i < y; i++) { returnValue = returnValue * (1+interestRate); } } BankDeposit :: BankDeposit(int p, int y, int r) { principal = p; years = y; interestRate = float(r)/100; returnValue = principal; for (int i = 0; i < y; i++) { returnValue = returnValue * (1+interestRate); } } void BankDeposit :: show(){ cout<<endl<<"Principal amount was "<<principal << ". Return value after "<<years << " years is "<<returnValue<<endl; } int main(){ BankDeposit bd3; int p, y; float r; int R; cout<<"Enter the value of p y and r"<<endl; cin>>p>>y>>r; BankDeposit bd1 = BankDeposit(p, y, r); bd1.show(); cout<<"Enter the value of p y and R"<<endl; cin>>p>>y>>R; BankDeposit bd2 = BankDeposit(p, y, R); bd2.show(); return 0; }
You create bd3 with default constructor here, so either you need the constructor or you need to create the pbject with argument. Note that the default constructor is generated for you implicitly only if your don't have other constructors
/
Help
/
what do this code mean ptrStore = (_DWORD *)(*(int (**)(void))(*(_DWORD *)*ptrStore + 92))();
/
not the full code
/
the int (**)(void)
/
pov: you have a nightmare
no it is from a decompiler
Anonymous
no it is from a decompiler
oh ok now it makes sense
/
oh ok now it makes sense
do youknow what that means
/
oh ok now it makes sense
what int (**)(void) means
Anonymous
idk but it’s possible
/
idk but it’s possible
it is because in the assembly view it show blx at the end of the code
/
idk but it’s possible
but do you know int (**)(void)
/
the assembly is this
/
.text:0000BCD0 LDR R0, [R5] .text:0000BCD2 LDR R2, [R0] .text:0000BCD4 LDR R2, [R2,#0x5C] .text:0000BCD6 BLX R2
Anonymous
it looks like a pointer to a pointer to an int function taking 0 args?
Anonymous
maybe i’m hella wrong a more experienced user can help
Anonymous
yes
/
yes
i only wanted to know what int (**)(void) does
Anonymous
good luck with the rest
/
good luck with the rest
yes but i still dont know what it mean
Anonymous
neither do i, what are you decompiling?
Pavel
what int (**)(void) means
https://cdecl.org/?q=int+%28**a%29%28void%29
/
https://cdecl.org/?q=int+%28**a%29%28void%29
but in the code i sent there isnt a
Pavel
i didnt know about that site
it is very useful for such cases, but note that I've added a variable name for it to understand
Pavel
but in the code i sent there isnt a
Yeah, it is pretty limited, needs a proper declaration
/
Yeah, it is pretty limited, needs a proper declaration
why if i write ptrStore = (_DWORD *)(*(int (**a)(void))(*(_DWORD *)*ptrStore + 92))(); it tells me bad charter '='
Pavel
I can't read those C types
Richard
this is a function pointer definition
Richard
you can use typedef for function pointer definition
/
the first is a cast
Richard
ok