- Как keep_window_open () не работает в зависимости от входных данных
- Решение
- Другие решения
- Folders keep opening in new windows in Windows 10
- Replies (7)
- Why does EDGE keep opening new windows?
- Replies (21)
- Default browser keeps opening new windows and resetting to homepage.
- Replies (10)
- Internet Explorer Keeps Opening New Windows
Как keep_window_open () не работает в зависимости от входных данных
Я запускал следующий код дважды.
Однажды, когда я введу Carlos 22 программа работала правильно и keep_window_open() по-видимому, работал, так как окно консоли оставалось открытым, и отображал «Please enter a character to exit» сообщение.
Но когда я ввожу 22 Carlos программа работает, как и ожидалось, но keep_window_open() не работает — он просто закрывается, как будто у меня вообще не было этой строки.
В чем причина такого поведения? И как лучше всего держать окно открытым при любых обстоятельствах?
Мой код:
Код и упражнение взяты из принципов и практики программирования с использованием C ++.
Решение
Это происходит потому, что реализация реализация keep_window_open() не игнорирует символы в буфере
Вот, cin.clear() очистит флаг ошибки, чтобы будущие операции ввода-вывода работали должным образом. Тем не менее, сбой у вас (пытается ввести Carlos в int ) оставляет строку Carlos в буфере. Чтение в ch затем получает C и программа выходит.
Ты можешь использовать cin.ignore() игнорировать символы в буфере после этого типа ошибки. Ты это видишь void keep_window_open(string s) в том же файле сразу ниже void keep_window_open() делает именно это
Другие решения
Это вызвано неправильным вводом cin ,
Вы можете добавить обработку ошибок, чтобы избежать такой проблемы:
Folders keep opening in new windows in Windows 10
Replies (7)
Thank you for posting your query in Microsoft Community.
I understand your concern, and we in Community will try to help you in the best possible way we can.
I suggest you to follow the below steps and check if it helps.
1. Open file explorer.
2. Click on view.
3. Click on options.
4. In General tab, select open each folder in the same Window.
Hope the information helps, if you have any further queries, feel free to post. We are here to assist you.
12 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Thanks Guru Kiran G for your response, but open each folder in the same Window is already applied in the General tab.
I’ve read that my profile might be corrupt, so I used a different profile and I still had the same issue. I got an update late last night that fixed it, but now it’s occurring once again.
Edit: It’s only happening in my Pictures folder. I checked if it was doing the same in my Downloads and Videos folder, but it didn’t.
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
Why does EDGE keep opening new windows?
When I have multiple tabs open and click on anothertab to switch, one time out of three EDGE decides to move the tab to a new window entirely.
Why, and/or how do I disable this?
I keep multiple tabs for a reason: I want quick access to all of them, and an uncluttered toolbar.
Replies (21)
* Please try a lower page number.
* Please enter only numbers.
* Please try a lower page number.
* Please enter only numbers.
Thank you for posting the query in Microsoft Community.
I would recommend you to open the Edge browser using a different User Account and check if the same issue occurs.
Refer to the below link for reference on how to create a new User Account.
( Note : Also applies to Windows 10)
Also try SFC scan to resolve the issue. SFC scans the corrupted files and recover it automatically.
To run the SFC/SCANNOW command in Windows 10:
Left click on Start button.
Right click on Command Prompt (Admin) option which will let you run ‘Run as administrator ’.
Command Prompt Window pops up.
Type: SFC /SCANNOW
You can also follow the link below for reference:
Get back with the updated status, we’ll be glad to assist you further.
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
You can grab a tab and pull it out of the current window to open in a new one.
This can happen if you accidentally rub the tab against the top of the window while you’re clicking the Tab.
Are you sure that this is not what happens?
17 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
I tried the SFC scan, and it did repair some corrupted files. However, it seems to be entirely unrelated to the issue of the opening of new windows.
You are probably right. That makes it actaully ‘working as intended’, but still pretty annoying. I also feel that it is happening more often than before, and I can not really imagine my hand-mouse coordination having deteriorated that much in such a sort time span. I therefore strongly suspect my new trackpad and mouse stick (I am on a Thinkpad) drivers to be the cullprit. Apart from being utterly useless, they might also have increased the pad’s and stick’s native sensitivity. I allready made a separate thread about a general issue I am having with those drivers:
As it also seems to be underlying the issues I am having with Edge, I wonder if you could have a look at that thread instead?
3 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
I apologize for not addressing you in a timely manner. Let me help you in resolving the issue.
I suggest you clear the Clear browsing data option of Microsoft Edge and check if you face the issue. To do so perform the steps below.
- Click on the More actions icon next to the feedback icon present on top right corner of the Edge.
- Select Settings and click on Choose what to clear.
- Check the boxes Browsing history, Cookies and saved website data and Cached data and files and click on Clear.
If you are using any Proxy connection, then try disabling the proxy connection and check.
Follow the steps to disable proxy:
- Click the Settings icon at the top right corner in internet explorer.
- Click the Tools button, and then click Internet Options.
- Click the Connections tab, and then click LAN settings.
- Uncheck the box next to “proxy server for your LAN”.
- Click on OK to save the setting and close window.
Now check the issue by opening Edge.
Hope the information helps. Please let us know if the issue persist and we will be happy to assist you further.
Default browser keeps opening new windows and resetting to homepage.
First, every browser keeps resetting to homepage/new tab page (depending on «On Startup» selection) whenever I’m working on a tab. I saw on the address line below it’s usually redirected many sites like “yandex.ru”, «msc». while the homepage is still on the screen. Then I accidentally “End process tree” of some “svchost.exe” and now my browser (default one only) randomly open new window, sometimes it’s non-stop like every 5 seconds, even when I changed default browser.
I’ve checked Extensions and Programs, nothing’s strange. I’ve scanned by Malwarebytes, BKAV Pro, RogueKiller, Spybot, SpyHunter, Registry Repair. and even installed Windows 10 but no luck. Now I can’t do anything, especially filling forms. Please help.
Replies (10)
I’m Greg, a volunteer installation specialist and 8 year Windows MVP, here to help you.
Just to run a Registry scanner like that will often ruin Windows beyond repair. I would check for infection and damaged System files now from Steps 7 and 11 in this checklist: http://answers.microsoft.com/en-us/windows/wiki.
The two best scanners for this type of possible infection are Malwarebytes and AdwCleaner. The others are either outdated or harmful.
Then go into each Browsers Add-Ons or Extensions and remove everything manually, under Search services remove all but Google.
I hope this helps. Feel free to ask back any questions and let us know how it goes. I will keep working with you until it’s resolved.
Over 100,000 helped in forums for 11 years. I don’t quit for those who are polite and cooperative.
Windows MVP 2010-21
2 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
See how to scan and clean your computer using both Windows Defender Security Center and ESET Sysrescue offline scanner:
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
2 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
It sounds like this issue is caused by a browser hijacker. This type of malware changes your browser homepage and other browser settings without your knowledge. In your example, the Yandex.ru browser hijacker is commonly bundled with other free programs that you download off of the Internet. Some free downloads do not adequately disclose that other software will also be installed, and you may find that you have installed a browser hijacker without your knowledge.
Since you have used Malwarebytes and AdwCleaner several times, let’s perform a clean boot. When you start your computer in a clean boot state, it starts by using a minimal set of drivers and startup programs. This troubleshooting method is designed to isolate if this issue is caused by a startup program or service. For steps on how to perform a clean boot, you can refer to the following link: How to perform a clean boot in Windows.
After you have finished troubleshooting, you may refer to the Reset the computer to start normally after clean boot troubleshooting section to reset the computer to start normally.
If the issues persists, we suggest that you start your PC in safe mode and try scanning your system for any malware infection while in safe mode. If you recently downloaded and installed a program from the Internet, kindly try to uninstall any suspicious applications while in safe mode. For steps on how to start your PC in safe mode, you can refer to the following link: Start your PC in safe mode in Windows 10.
Let us know the results so we can assist you further.
Internet Explorer Keeps Opening New Windows
I have been experiencing this problem since yesterday. The internet explorer (V7) will all of a sudden starts keep opening new windows endlessly. The only way that I could stop this is by using CTRL+AlT+DEL option to stop IE.exe process. Any suggestions to fix this problem is appreciated.
There is a very good chance that you are seeing the effects of a hijackware infection!
NB: If you had no anti-virus application installed or the subscription had expired *when the machine first got infected* and/or your subscription has since expired and/or the machine’s not been kept fully-patched at Windows Update, don’t waste your time with any of the below: Format & reinstall Windows. A Repair Install will NOT help!
Microsoft PCSafety provides home users (only) with no-charge support in dealing with malware infections such as viruses, spyware (including unwanted software), and adware.
https://support.microsoft.com/oas/default.aspx?&prid=7552&st=1
Also available via the Consumer Security Support home page: https://consumersecuritysupport.microsoft.com/
NB: Run the FULL scan, not the QUICK scan! You may need to download the MSRT on a non-infected machine, then transfer MRT.EXE to the infected machine and rename it to SCAN.EXE before running it.
2a. WinXP => Run the Windows Live Safety Center’s ‘Protection’ scan (only!) in Safe Mode with Networking, if need be:http://onecare.live.com/site/en-us/center/howsafe.htm
3. Now post the requested logs in an appropriate forum for assistance by an expert in such matters. DO NOT SKIP THIS STEP!!
If these procedures look too complex — and there is no shame in admitting this isn’t your cup of tea — take the machine to a local, reputable and independent (i.e., not BigBoxStoreUSA or Geek Squad) computer repair shop.
Robear Dyer (PA Bear)
MS MVP (IE, Mail, Security, Windows & Update Services) since 2002
Disclaimer: MS MVPs neither represent nor work for Microsoft
Robear Dyer (PA Bear)
Microsoft MVP (Windows Client) since October 2002