CLion doesn't show expected output

已回答

Hi there.

I use CLion to program in C language for university purposes but I have got a problem. When I compile and run any program it does not show the correct output that would be 

printf ("b[4] = %f", b[4]);

Here's the full code:

2

Hi!

We have the issue in the tracker already: https://youtrack.jetbrains.com/issue/CPP-2580. Feel free to comment or upvote and sorry for the inconvenience. 

As a workaround please try doing the following: in Registry (`Help | Find Action...`, type `Registry` there) disable the `run.processes.with.pty` option and restart CLion. Does that help?

0
Avatar
Permanently deleted user

Hi Anna, thanks for the reply.

Unfortunately, the solution you suggested did not work. 

 

EDIT: Looks like I cannot disable that option because after restarting CLion and checking the 'Registry', it's still enabled!

0

@Nicodemo, yes, unfortunately, the run.processes.with.pty option is not saved after CLion's restart and should be disabled again every time you open CLion (if you need it to be disabled). We have the issue in our tracker about that: https://youtrack.jetbrains.com/issue/CPP-8395. Please check it out. Feel free to comment or upvote; follow to get updates.

Please disable `run.processes.with.pty` option in Registry (don't restart CLion after that) and enter the following string of code before any printing (it disables buffering): 

setbuf(stdout, 0);

Then Run the project. Does it help?

0

请先登录再写评论。