|
Member 14968771 wrote: do not get so huffy. There's only one person here who gets huffy.
The main problem with your question is that it is far from clear exactly what you are trying to do, or why you are using QT. If you merely want to capture the output of some command, then running it in xterm is not a good choice. But since the reason for xterm was not clear I did not originally question it. However, I did point out that connecting processes via stdin, stdout is something that has been around since the early days of Linux/Windows, and is actually fully supported by QProcess.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
Member 14968771 wrote: you are avoiding to provide a solution. Yes, mainly because I still do not really understand what you are trying to achieve. But, hey ho, that seems to be par for the course with your questions.
|
|
|
|
|
Write a program that calculates the following expression: total = (num3 + num4) - (num1 + num2) + 1
|
|
|
|
|
OK, I've done that. Where do I submit my invoice for payment?
Seriously, nobody here is going to do your homework for you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Greetings Kind Regards Each of the two uses of the type trait is_base_of compiles differently. One w/ error the other w/o. Any idea why the difference? It is documented as requiring a completed type I am not certain as to its meaning but the question remains why the difference? Thank You Kindly
The precise error message wrt the requires expression is:
1>D:\a\_work\1\s\binaries\x86ret\inc\type_traits(1152,28): error C2139: 'cDERIVED': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_base_of'
hello_world.cpp(5): message : see declaration of 'cDERIVED'
hello_world.cpp(7): message : see reference to variable template 'const bool is_base_of_v<cbase,cderived>' being compiled
hello_world.cpp(9,2): error C7602: 'cDERIVED::someClass': the associated constraints are not satisfied
hello_world.cpp(8): message : see declaration of 'cDERIVED::someClass'
hello_world.cpp(7,32): message : the constraint was not satisfied
hello_world.cpp(9,22): error C2955: 'cDERIVED::someClass': use of class template requires template argument list
hello_world.cpp(8): message : see declaration of 'cDERIVED::someClass'
1>Done building project "hello_world.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:02.511 ==========
import std.core;
using namespace std;
class cBASE {};
struct cDERIVED : public cBASE
{
template<typename T> requires is_base_of_v<cBASE, cDERIVED> class someClass {};
someClass<cDERIVED> someData;
constexpr bool TEST_is_base_of() { return is_base_of_v<cBASE, cDERIVED>; } };
int main()
{
cout << "Hello World\n";
cout << boolalpha;
cDERIVED _derived;
cout << _derived.TEST_is_base_of();
}
modified 28-Sep-22 14:14pm.
|
|
|
|
|
Could you post the exact error that you are seeing?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Thank You for your interest. Please see updated post. Kind Regards
|
|
|
|
|
I am saving a series of floating point numbers in CSV. I heard that under some European locale, the decimal point in floating point is actually a comma, I was wondering if I release this product in a European market, will my library have trouble parsing the floats since my decimal point is a full stop, not a comma.
Does anyone encounter this problem in those locales? How do you handle it?
Thanks in advance.
|
|
|
|
|
Any decent CSV library should take care of this by quoting anything containing the field delimiter (in this case, comma).
I just did a simple test with LibreOffice Calc:
* entered 123.45 and 246.80 in the first two cells.
* changed its locale to German
* saved as csv
The result: "123,45","246,80"
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Thank you for your reply. How about parsing float numbers with full stops in German locale? I am not sure if the C++ stof() handles it since the C++ Reference page states it is determined by the current C locale.
std::stof, std::stod, std::stold - cppreference.com
|
|
|
|
|
I haven't done anything serious in that area for at least a decade, but from memory you need to set the locale programmatically to be sure of where you are when you parse input.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
There is any we understand or convert or any other way we use .hex file and creat any plc language or program in plc language
|
|
|
|
|
And what is your question?
|
|
|
|
|
Yes many ways, but you will need more information before you can start. Firstly you need to understand the format of the data in the "hex" file. Then you need to understand the instruction set (and format) of the plc language. Once you understand both those things you can start to design your converter.
|
|
|
|
|
I want the way how can we learn these ways
I have some knowledge about plc languages but didn't know about the C,C++,asemly language too.
Please help me the way I can understand
|
|
|
|
|
Like I said, you first need to understand the format of the "hex" (whatever that means) file. You also need to understand exactly what it is you want to convert it into.
And without a lot more information it is impossible to make any better suggestions.
|
|
|
|
|
This is an example of what you're in for.
Get any HEX editor, like HxD[^], and install it. Now go grab the Notepad.exe file from C:\Windows and open it in the hex editor.
Now you're looking at a whole of bunch of bytes that make up the content of the file, and you need documentation to tell you what every one of those bytes means. You're going to start here[^] to figure that out.
Oh, and when you get to actual executable code, you're going to have to understand the Intel instruction set, all the addressing modes, and the operands each instruction requires. All of that is in the bytes that make up the executable code. Notice, you're not going to get back C/C++ code. You're getting back assembly code.
Once you're brain melts from trying to understand all that, now you have to do that same thing for the .hex file you're looking at for your PLC's. Oh, and you'll need all the relevant documentation similar to this example of disassembling Notepad.
Do you get it now?
|
|
|
|
|
Do you mean Intel HEX - Wikipedia[^] ?
That is pretty straightforward.
Using it for creating a 'plc language' or a 'program in plc language' is a bit obscure, as far as I can understand.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
This is not a C++ question, basic or otherwise. It is a QT question. You will probably get a better answer from a QT specific forum.
Keep Calm and Carry On
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
It's the constructor of a class called MainWindow . QMainWindow and ui are being initialized using an initialization list.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It is a single parameter constructor of the MainWindow class. The constructor accepts a single parameter which is a pointer to a QWidget object. The constructor sets its QMainWindow property to the input parameter - in this case the pointer named parent . It then sets its ui property by calling the Ui::MainWindow constructor, to create a new object of that class. To find out what the latter returns you need to look at the Ui class documentation.
|
|
|
|
|
Message Closed
modified 2-Oct-22 15:46pm.
|
|
|
|