Qt Programming Language



  • @Annabelle
    Well, I think you will have that problem with any of the IDE tools available as they all basically do things in the same way. Dragging and dropping GUI elements onto the screen is probably quite a difficult thing to with the assistance of a screen reader. You can however create GUIs without using the graphical interface designer by just programming them directly with code yourself. There is much more coding to be done but many people do it that way.



  • @kenchan said in Qt Programming Language:

    @Annabelle
    Well, I think you will have that problem with any of the IDE tools available as they all basically do things in the same way. Dragging and dropping GUI elements onto the screen is probably quite a difficult thing to with the assistance of a screen reader. You can however create GUIs without using the graphical interface designer by just programming them directly with code yourself. There is much more coding to be done but many people do it that way.

    When I finish the code, I'm wondering what compiler I could use that would be completely accessible for me. Coding in C++ is what I'm learning through www.learncpp.com, and the IDE part is where I'm stuck in a rut.


  • Moderators

    @Annabelle said in Qt Programming Language:

    Coding in C++ is what I'm learning through www.learncpp.com, and the IDE part is where I'm stuck in a rut.

    Read my post from yesterday. Windows Narrator reads out the Alt menus for me. Does JAWS say anything when you press and release Alt, then press and release Tab in Qt Creator?

    Also, what version of Qt Creator did you install? (You can check by pressing and releasing keys in this order: Escape, Alt, H, Q)



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    Coding in C++ is what I'm learning through www.learncpp.com, and the IDE part is where I'm stuck in a rut.

    Read my post from yesterday. Windows Narrator reads out the Alt menus for me. Does JAWS say anything when you press and release Alt, then press and release Tab in Qt Creator?

    Also, what version of Qt Creator did you install? (You can check by pressing and releasing keys in this order: Escape, Alt, H, Q)

    Qt Creator 4.7.0 based on Qt 5.11.1 MSVC 2015. As for Windows Narrator, it announces most stuff as "Unknown" or "Unknown Key". What's up with that, I wonder?


  • Moderators

    @Annabelle said in Qt Programming Language:

    Qt Creator 4.7.0 based on Qt 5.11.1 MSVC 2015.

    OK, that's a good recent version.

    As for Windows Narrator, it announces most stuff as "Unknown" or "Unknown Key". What's up with that, I wonder?

    Do you mean Windows Narrator announces them as "Unknown", while JAWS doesn't announce them at all?



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    Qt Creator 4.7.0 based on Qt 5.11.1 MSVC 2015.

    OK, that's a good recent version.

    As for Windows Narrator, it announces most stuff as "Unknown" or "Unknown Key". What's up with that, I wonder?

    Do you mean Windows Narrator announces them as "Unknown", while JAWS doesn't announce them at all?

    Yes, that's exactly what I mean.


  • Moderators

    @Annabelle said in Qt Programming Language:

    As for Windows Narrator, it announces most stuff as "Unknown" or "Unknown Key". What's up with that, I wonder?

    Do you mean Windows Narrator announces them as "Unknown", while JAWS doesn't announce them at all?

    Yes, that's exactly what I mean.

    OK, I managed to load an old machine which runs Windows 7 Enterprise SP1, and I installed Qt Creator 4.7.0 on it. I launched the Microsoft Narrator that came bundled with Windows 7. I used its default settings: "Echo User's Keystrokes" and "Announce System Messages".

    Here is what I did and what I heard:

    1. When I launched Qt Creator, Microsoft Narrator said, "Window opened. Quartz Creator."
    2. When I pressed Alt, Microsoft Narrator said, "Alt. File. Menu Item. Menu key Alt plus 'F'. Menu bar with 8 items."

    So Qt Creator 4.7.0 should be accessible to screenreaders on Windows 7. I can't understand why your copy of Microsoft Narrator only reads "Unknown".

    In your community, are there any programmers or folks who are knowledgeable with computers? It could be worth getting their assistance. I'm afraid that our ability to help you through an online forum is quite limited.



  • @JKSH I've switched from Visual Studio to Codeblocks, since that particular IDE:

    1. Didn't take forever to install on my machine.
    2. Didn't require any further Windows updates.
    3. Didn't require a Microsoft account or any other account to use.
    4. Doesn't take up much room on my machine.
    5. It's more accessible to screenreaders than Visual Studio or Qt Creator.

    That being said, out of curiosity, if I was to code a Qt project with Codeblocks, is it possible that the code I make would be translated into the actual elements like buttons, checkboxes, sliders, textboxes, radio buttons, text areas, combo boxes, and the like? I know that in Codeblocks, each type of project has an Editor window, so if I focus on that, I would be able to put the code in there, then compile the finished project. I've even registered with the forum at http://www.cplusplus.com, but the people there told me that C++ isn't exactly the language for making GUI elements, and that something like Qt would be a framework for those. I did, however, manage to create a "Hello World" project in C++ with Codeblocks. How would I share that on this forum?


  • Moderators

    Hi @Annabelle,

    You've taken many good initiatives to learn C++; well done.

    I've switched from Visual Studio to Codeblocks, since that particular IDE:

    1. Didn't take forever to install on my machine.
    2. Didn't require any further Windows updates.
    3. Didn't require a Microsoft account or any other account to use.
    4. Doesn't take up much room on my machine.
    5. It's more accessible to screenreaders than Visual Studio or Qt Creator.

    These are good reasons to use the Code::Blocks IDE.

    Out of curiosity, if I was to code a Qt project with Codeblocks, is it possible that the code I make would be translated into the actual elements like buttons, checkboxes, sliders, textboxes, radio buttons, text areas, combo boxes, and the like?

    Yes. Each GUI element in Qt is represented by a C++ object. So, if you want to create a button, all you have to do is to write code that constructs a QPushButton object, and then call a function to make it visible on the screen.

    This process is completely independent of the IDE. Regardless of whether you use Qt Creator or Visual Studio or Code::Blocks, the code you write to create the Qt button would be exactly the same.

    I know that in Codeblocks, each type of project has an Editor window, so if I focus on that, I would be able to put the code in there, then compile the finished project.

    Have you managed to compile and run a Hello World project in Code::Blocks yet?

    I've even registered with the forum at http://www.cplusplus.com, but the people there told me that C++ isn't exactly the language for making GUI elements, and that something like Qt would be a framework for those.

    They are correct in a sense. The C++ language itself does not have the concept of GUIs. Nonetheless, Qt is a C++ library that enables you to write C++ code to create GUIs.

    I did, however, manage to create a "Hello World" project in C++ with Codeblocks. How would I share that on this forum?

    To share a small project, just copy your C++ code from the Code::Blocks Editor and paste them into this forum. The C++ code is all text.



  • @JKSH said in Qt Programming Language:

    Hi @Annabelle,

    You've taken many good initiatives to learn C++; well done.

    I've switched from Visual Studio to Codeblocks, since that particular IDE:

    1. Didn't take forever to install on my machine.
    2. Didn't require any further Windows updates.
    3. Didn't require a Microsoft account or any other account to use.
    4. Doesn't take up much room on my machine.
    5. It's more accessible to screenreaders than Visual Studio or Qt Creator.

    These are good reasons to use the Code::Blocks IDE.

    Out of curiosity, if I was to code a Qt project with Codeblocks, is it possible that the code I make would be translated into the actual elements like buttons, checkboxes, sliders, textboxes, radio buttons, text areas, combo boxes, and the like?

    Yes. Each GUI element in Qt is represented by a C++ object. So, if you want to create a button, all you have to do is to write code that constructs a QPushButton object, and then call a function to make it visible on the screen.

    This process is completely independent of the IDE. Regardless of whether you use Qt Creator or Visual Studio or Code::Blocks, the code you write to create the Qt button would be exactly the same.

    I know that in Codeblocks, each type of project has an Editor window, so if I focus on that, I would be able to put the code in there, then compile the finished project.

    Have you managed to compile and run a Hello World project in Code::Blocks yet?

    I've even registered with the forum at http://www.cplusplus.com, but the people there told me that C++ isn't exactly the language for making GUI elements, and that something like Qt would be a framework for those.

    They are correct in a sense. The C++ language itself does not have the concept of GUIs. Nonetheless, Qt is a C++ library that enables you to write C++ code to create GUIs.

    I did, however, manage to create a "Hello World" project in C++ with Codeblocks. How would I share that on this forum?

    To share a small project, just copy your C++ code from the Code::Blocks Editor and paste them into this forum. The C++ code is all text.

    When I attempt to compile the Hello World project in Codeblocks, I get this error.
    0_1563188446312_76b07a7b-ecac-4a4d-82c6-7cd5ddea2d1f-image.png
    What did I do wrong?


  • Qt Champions 2018

    @Annabelle Did you install MinGW? If so, is c:\MinGW\bin\gcc.exe valid path pointing to the C compiler?



  • @jsulm said in Qt Programming Language:

    @Annabelle Did you install MinGW? If so, is c:\MinGW\bin\gcc.exe valid path pointing to the C compiler?

    1. Yes.
    2. Yes.

    And now when I try to build and run, I get this error.

    0_1563232976718_8368a9aa-c6aa-4760-b14a-5187cccbdd8e-image.png


  • Moderators

    @Annabelle said in Qt Programming Language:

    And now when I try to build and run, I get this error.

    I don't have experience with Code::Blocks, so my ability to help you is a bit limited. Nonetheless, my guess is that you installed Code::Blocks first, and then you downloaded MinGW from a different place. Is this correct? If so, there is likely a configuration problem.

    The cleanest way forward is probably to:

    1. Uninstall Code::Blocks
    2. Uninstall MinGW
    3. Download the single package which sets up both for you. Select codeblocks-17.12mingw-setup.exe from http://www.codeblocks.org/downloads/26

    If you still have issues after all of this, the folks at the Code::Blocks forum might be better able to help you: forums.codeblocks.org/



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    And now when I try to build and run, I get this error.

    I don't have experience with Code::Blocks, so my ability to help you is a bit limited. Nonetheless, my guess is that you installed Code::Blocks first, and then you downloaded MinGW from a different place. Is this correct? If so, there is likely a configuration problem.

    The cleanest way forward is probably to:

    1. Uninstall Code::Blocks
    2. Uninstall MinGW
    3. Download the single package which sets up both for you. Select codeblocks-17.12mingw-setup.exe from http://www.codeblocks.org/downloads/26

    If you still have issues after all of this, the folks at the Code::Blocks forum might be better able to help you: forums.codeblocks.org/

    I tried downloading Codeblocks Mingw Setup from https://sourceforge.net/projects/codeblocks/, but it fails every time. What do I do next?


  • Qt Champions 2018

    @Annabelle said in Qt Programming Language:

    but it fails every time

    Works here. Do you have bad Internet connection?
    Try https://www.fosshub.com/Code-Blocks.html?dwl=codeblocks-17.12mingw-setup.exe



  • @jsulm said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    but it fails every time

    Works here. Do you have bad Internet connection?
    Try https://www.fosshub.com/Code-Blocks.html?dwl=codeblocks-17.12mingw-setup.exe

    My internet connection is through the main headquarters of the apartment complex in which I live. It's powered by Centurylink, and can be hit or miss at times.


  • Qt Champions 2018

    @Annabelle Did you try the link I posted?



  • @jsulm said in Qt Programming Language:

    @Annabelle Did you try the link I posted?

    Yes. First it failed, then when I switched from my thumb drive to a backup hard drive and tried again, it succeeded!



  • @jsulm said in Qt Programming Language:

    @Annabelle Did you try the link I posted?

    Yes. And now when I try to compile my "Hello World" project, I get this error.
    0_1563756476436_4d68067f-d68d-47df-a74f-0b2a886db32b-image.png
    What did I do wrong?


  • Moderators

    @Annabelle said in Qt Programming Language:

    And now when I try to compile my "Hello World" project, I get this error.

    The error says that your compiler is too old and it doesn't support the C++ 2011 standard. But I'm confused: If you're doing a basic C++ Hello World program, why is Code::Blocks trying to include Qt?

    I suggest you leave Qt out for now. Just focus on learning plain C++. This way, it doesn't matter if you have an old compiler.



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    And now when I try to compile my "Hello World" project, I get this error.

    The error says that your compiler is too old and it doesn't support the C++ 2011 standard. But I'm confused: If you're doing a basic C++ Hello World program, why is Code::Blocks trying to include Qt?

    I suggest you leave Qt out for now. Just focus on learning plain C++. This way, it doesn't matter if you have an old compiler.

    Now when I compile a project, with regular C++ code, here's what I got in return.

    0_1563905512388_14fc52e1-5a2f-4ad6-9bde-9e719908888d-image.png



  • @Annabelle
    It looks like you have progressed! It seems to be successfully rubnning your gcc compiler.

    You should open up your Sources folder in the left-hand pane so that we can see what file(s) you have. And perhaps open your main/only .cpp source file into the right-hand pane so that we can see that too.

    The error message indicates that some .cpp source file has an "odd" character in it, on line #9. The sort of stray character that perhaps got in there from a mis-typing.


  • Moderators

    @Annabelle said in Qt Programming Language:

    Now when I compile a project, with regular C++ code, here's what I got in return.

    The error message is "stray '\240' in program". This means your .cpp file contains a character that the compiler does not accept.

    '\240' is a specially-formatted character that represents a space. It can appear when someone copies code from a website or a program like Microsoft Word, and then pastes it into their IDE.

    Your compiler says that the error is in line 9. I suggest you completely erase lines 8 to 10 to get rid of the '\240' character, and then re-type those lines by hand.



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    Now when I compile a project, with regular C++ code, here's what I got in return.

    The error message is "stray '\240' in program". This means your .cpp file contains a character that the compiler does not accept.

    '\240' is a specially-formatted character that represents a space. It can appear when someone copies code from a website or a program like Microsoft Word, and then pastes it into their IDE.

    Your compiler says that the error is in line 9. I suggest you completely erase lines 8 to 10 to get rid of the '\240' character, and then re-type those lines by hand.

    What's the \240 character? I'm confused on that one!


  • Moderators

    @Annabelle said in Qt Programming Language:

    What's the \240 character? I'm confused on that one!

    As I mentioned before, it is a specially-formatted character that represents a space.

    There are many ways to represent text: Sighted people draw lines to represent a character, Braille users arrange dot patterns to represent a character, while computers use a number to represent a character. For example, computers represent 'A' as the number 65, 'B' as the number 66, and so on.

    In computers, there are multiple ways to represent a space. \240 is one such representation. Unfortunately, this representation causes problems for your compiler when it is pasted into your IDE.

    Since it is a space character, I doubt that your screenreader will read it out. Sighted people can't see the bad character on the screen either.

    The easiest thing to do is to erase the offending line from your code and re-type the whole line by hand.



  • @JKSH said in Qt Programming Language:

    @Annabelle said in Qt Programming Language:

    What's the \240 character? I'm confused on that one!

    As I mentioned before, it is a specially-formatted character that represents a space.

    There are many ways to represent text: Sighted people draw lines to represent a character, Braille users arrange dot patterns to represent a character, while computers use a number to represent a character. For example, computers represent 'A' as the number 65, 'B' as the number 66, and so on.

    In computers, there are multiple ways to represent a space. \240 is one such representation. Unfortunately, this representation causes problems for your compiler when it is pasted into your IDE.

    Since it is a space character, I doubt that your screenreader will read it out. Sighted people can't see the bad character on the screen either.

    The easiest thing to do is to erase the offending line from your code and re-type the whole line by hand.

    I typed the offending line by hand, and here's what I got.
    0_1563966708194_ba140787-381a-4ed3-9668-989f1535714a-image.png


  • Qt Champions 2018

    @Annabelle Looks good, it works



  • @Annabelle said in Qt Programming Language:

    not sure Qt is a Programming Language, maybe this was already discussed, hard to know when topic has 300+ posts...
    It looks like the OP never created a new thread and asked all his questions in the same one.


  • Lifetime Qt Champion

    @LeLev
    Hi
    She is using a screen reader so I think its easier for her to use the same thread.



  • @mrjj ah ok! my bad



  • @jsulm said in Qt Programming Language:

    @Annabelle Looks good, it works

    Cool-ee-o! So what do I do next?


  • Qt Champions 2018

    @Annabelle: Congrats, your program is compiling and running.

    However, it does not seem to output any useful yet.

    So the next thing would be to actually make your program to output "Hello World!" (or any other greeting you can think of).

    Good luck!



  • @aha_1980 said in Qt Programming Language:

    @Annabelle: Congrats, your program is compiling and running.

    However, it does not seem to output any useful yet.

    So the next thing would be to actually make your program to output "Hello World!" (or any other greeting you can think of).

    Good luck!

    Isn't that what the line, "std::cout << "Hello, World!"; is supposed to do? I'm confused!


  • Qt Champions 2018

    Hi @Annabelle,

    Isn't that what the line, "std::cout << "Hello, World!"; is supposed to do? I'm confused!

    Yes, it is. Do you have this output somewhere on your screen? In the screenshots you provided, I didn't see it.

    If you already have that, then the next steps could be:

    1. Print "Hello World" ten times, with an upcounting number appended, like:
    Hello World 1
    Hello World 2
    Hello World 3
    ...
    Hello World 10
    
    1. Ask the user for his name, and greet him. That could look like this:
    Hello, what's your name?
    Luke
    Nice to meet you, Luke!
    

    That would then almost be a complete program, taking an input and providing an output. Only the data processing is missing - but we can add that later.

    Regards



  • @Annabelle
    Hi Annabelle.

    Isn't that what the line, "std::cout << "Hello, World!"; is supposed to do? I'm confused!

    As I mentioned earlier, we cannot see your source code in the screenshots. You need to open your source file so that we at least can see its contents.

    If you were currently editing your .cpp file's content, I assume you have to have it open, e.g. so your screen reader can read its content. Can you get to that state and post screenshot?



  • @JonB said in Qt Programming Language:

    @Annabelle
    Hi Annabelle.

    Isn't that what the line, "std::cout << "Hello, World!"; is supposed to do? I'm confused!

    As I mentioned earlier, we cannot see your source code in the screenshots. You need to open your source file so that we at least can see its contents.

    If you were currently editing your .cpp file's content, I assume you have to have it open, e.g. so your screen reader can read its content. Can you get to that state and post screenshot?

    How's this?
    0_1564026008478_a78a4405-c20a-4616-b15e-09d67a7e7238-image.png



  • @JonB said in Qt Programming Language:

    @Annabelle
    Hi Annabelle.

    Isn't that what the line, "std::cout << "Hello, World!"; is supposed to do? I'm confused!

    As I mentioned earlier, we cannot see your source code in the screenshots. You need to open your source file so that we at least can see its contents.

    If you were currently editing your .cpp file's content, I assume you have to have it open, e.g. so your screen reader can read its content. Can you get to that state and post screenshot?

    How about this one.
    0_1564026313636_ece6e8dd-5eed-4e06-92f8-909491c8ad37-image.png


  • Qt Champions 2018

    Hi @Annabelle,

    Ok, that shows us your current main function. So far so good!

    What you did there, is called hardcoding. That means, your program does greet you, but it can only great you and no one else.

    Before we proceed I have an important question. When you run your program, do you get the greeting output on some window? That is an important point, because that's why we do all this programming, right?

    And once that is working the task is really, to not only greet Annabelle, but also Vladimir, Julia, Rodriguez, and Sabrina, ...

    To do this, you will need to get some input into your program, and store the input for further processing.

    Regards



  • @Annabelle
    Hi Annabelle,

    Yep, the latest screenshot allows us to see your code! You'll want to show us that when you have a question about your code. (At a later date if the code gets too long to show in that screen we'll have to do something else, but that can wait for now.)

    A couple of points:

    1. Earlier you had a compilation error, about a funny character in the code, at line #9, I believe. It seems to be compiling now, I think, so you may have dealt with that. But your lines 9, 10 and 11 are just an open-curly-brace, a blank line, and then a close-curly-brace. These do nothing, and are not useful in your code. Delete lines 9 to 11 inclusive, or replace them with a single blank line which looks nice to us (a gap between the #include line and the start of your main() function), but you may not be fussed about blank lines/layout.

    2. As @aha_1980 has written, your program produces some lines of output sent to what is called "stdout" via your std::cout lines. This should produce some output somewhere (which can presumably be read to you), but we cannot see where that might be. The development environment you are using, known as an "IDE", is in charge of where that goes.

    What we can see is that the "Build log" tab you are displaying, which shows the results of compiling, does not seem to include this output. Maybe there is a different tab at the bottom, scrolled off to the right, which has some sort of "Output" pane to send to? Or --- and it gets confusing now, I am only guessing --- the "Build log" seems to be showing that when your IDE runs your "Hello World" program it does it by passing it to an internal CodeBlocks or CodeRunner program named cb_console_runner.exe. Note the use of "console" there. It may be that opens up a "console" (like an output window) when it runs to display your program's output, and that might automatically go away when your program ends, I don't know.

    EDIT I think I now understand your IDE is Code::Blocks (not CodeRunner). I have done some brief Googling, which you may want to do, for CodeBlocks stdout. There are indeed various hits about "how do I get to see the output from my program from CodeBlocks".

    If we take, say, https://stackoverflow.com/questions/28878911/how-can-i-get-console-output-in-code-block-ide, the guy there has a similar program to yours. One thing we are told is

    Click on build->run or hit Ctrl+F10 and a new CMD Window should pop up, showing you your "Hello world!".

    So that tells us it does indeed need to open a separate command/output window to send the output to. Does your screenreader tell you this window gets opened or read its content?

    Then the last response there says:

    Please include getchar() in the function before return statement. This happens because the computer is executing your program and doesn't wait for you to see the output. Including getchar(), at the end mandates it to wait for an input & in the meanwhile you can observe your output

    I did wonder if this might be the case. Because your program outputs some lines and then simply terminates, it may well be that this console output window pops up when you run your program, shows the lines, and then immediately exits. So you/your screenreader may know nothing about it. You need to cause the program to "pause" before it exists so you can examine this output window.

    I'm not a C++ expert, but I believe you should try inserting the following two lines after all your std::cout lines and immediately before your return 0; line:

    std::string input;
    std::getline(std::cin, input);
    

    If you do that, when you run your program I believe/hope it will not immediately run to exit as it does now. You will have to "find" that new output window and click the Enter key in it before it exits and then your program completes. Hopefully you can then get your screenreader to read it out before you press the key?



  • @jonb said in Qt Programming Language:

    @Annabelle
    Hi Annabelle,

    Yep, the latest screenshot allows us to see your code! You'll want to show us that when you have a question about your code. (At a later date if the code gets too long to show in that screen we'll have to do something else, but that can wait for now.)

    A couple of points:

    1. Earlier you had a compilation error, about a funny character in the code, at line #9, I believe. It seems to be compiling now, I think, so you may have dealt with that. But your lines 9, 10 and 11 are just an open-curly-brace, a blank line, and then a close-curly-brace. These do nothing, and are not useful in your code. Delete lines 9 to 11 inclusive, or replace them with a single blank line which looks nice to us (a gap between the #include line and the start of your main() function), but you may not be fussed about blank lines/layout.

    2. As @aha_1980 has written, your program produces some lines of output sent to what is called "stdout" via your std::cout lines. This should produce some output somewhere (which can presumably be read to you), but we cannot see where that might be. The development environment you are using, known as an "IDE", is in charge of where that goes.

    What we can see is that the "Build log" tab you are displaying, which shows the results of compiling, does not seem to include this output. Maybe there is a different tab at the bottom, scrolled off to the right, which has some sort of "Output" pane to send to? Or --- and it gets confusing now, I am only guessing --- the "Build log" seems to be showing that when your IDE runs your "Hello World" program it does it by passing it to an internal CodeBlocks or CodeRunner program named cb_console_runner.exe. Note the use of "console" there. It may be that opens up a "console" (like an output window) when it runs to display your program's output, and that might automatically go away when your program ends, I don't know.

    EDIT I think I now understand your IDE is Code::Blocks (not CodeRunner). I have done some brief Googling, which you may want to do, for CodeBlocks stdout. There are indeed various hits about "how do I get to see the output from my program from CodeBlocks".

    If we take, say, https://stackoverflow.com/questions/28878911/how-can-i-get-console-output-in-code-block-ide, the guy there has a similar program to yours. One thing we are told is

    Click on build->run or hit Ctrl+F10 and a new CMD Window should pop up, showing you your "Hello world!".

    So that tells us it does indeed need to open a separate command/output window to send the output to. Does your screenreader tell you this window gets opened or read its content?

    Then the last response there says:

    Please include getchar() in the function before return statement. This happens because the computer is executing your program and doesn't wait for you to see the output. Including getchar(), at the end mandates it to wait for an input & in the meanwhile you can observe your output

    I did wonder if this might be the case. Because your program outputs some lines and then simply terminates, it may well be that this console output window pops up when you run your program, shows the lines, and then immediately exits. So you/your screenreader may know nothing about it. You need to cause the program to "pause" before it exists so you can examine this output window.

    I'm not a C++ expert, but I believe you should try inserting the following two lines after all your std::cout lines and immediately before your return 0; line:

    std::string input;
    std::getline(std::cin, input);
    

    If you do that, when you run your program I believe/hope it will not immediately run to exit as it does now. You will have to "find" that new output window and click the Enter key in it before it exits and then your program completes. Hopefully you can then get your screenreader to read it out before you press the key?

    Here's a screenshot of what my project looks like now.
    0_1564177921376_fab80b48-d5dd-4d3a-b0f7-08a520e8af57-image.png
    And here's a screenshot of the code.
    0_1564177954379_79727094-32ac-4da2-a426-6e8d36889568-image.png


Log in to reply