convert pascal to c++, i do not know about pascal [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
PBYTE(inAddr)^ := $E8;
PDWORD(inAddr + 1)^ := rMemAddr - inAddr - 5;
I need convert code to c++, but i do not know about Pascal, pls help me, thanks!
I tryed, but the two line code is wrong.

Taking a guess I would say
*(uint8_t*)inAddr = 0xE8;
*(uint32_t*)(inAddr + 1) = rMemAddr - inAddr - 5;
I do remember that ^ is the indirection operator in Pascal and := is the assignment operator.

Related

Taking input using delimiter in C++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
After taking those values I have to store the values in two different arrays (say x and y)
So the only error I can immediately see is this
float* a = NULL;
a = new(nothrow)float;
which should be
float* a = new float[count];
Your version only allocates enough space for a single float when you really need space for count floats.
When you have code that isn't working, and you want to ask a question about it you really should say exactly what happens when you run the code. Doing this will help get you better answers.

Regex expression to replace string with * [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to convert string like this to
ABC_464_aDE.hmi_2df
to ABC464aDE.* that is want to remove all _ and add * at the end after dot. And my project requirement is to do this using regex. Please help to sort this out.
Thanks
If you are using C# the you can use this code
txt=Regex.Replace(txt.Replace("_",""), #"\.\w+", "");

How to write this mathematical formula in C++? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a simple formula and I want to use it in C++ application.
Not sure how to rewrite in C++.
logn(5, abs((a*b - d*c) / (tan(c) + sin(d))))
where logn is:
double logn(double base, double x) {
return log(x) / log(base);
}
and the header cmath is included for the other functions.
You can do this, be careful with libs, namespaces, and radian arguments
z = a*b - d*c;
s = tan(c) + sin(d);
num = abs(z/s);
log(num)/log(5);
http://www.cplusplus.com/reference/cmath/

C++ input value process as math function [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I’m very new in C++ and I need your help. I want to use the input value as a mathematical function then print the result.
What i need is:
When user input: 2 +1 and hit Enter then output (cout>>)
should be your result is: 3 (the sum of 2 + 1)
The mathematical symbol could be + or * or / or -.
Could you please help me with some example?
Thanks in advance!
Search for "Reverse Polish notation" and implementation in C++

Turning a string that contains a equation into an integer [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to be able to convert a string such as "(5+6)*6" and get the resulting integer from that equation. It is important that it starts out as a string.
You can use library fastmathparser for c++.
In link is example how use this library.
If you really want write alone this parser, I recomended use Shunting-yard algorithm