Hi
I have recently been facing some error messages in my IDE (Visual Studio Code), and an error always pops up displaying "cin is ambiguous". I tried to look online but only found some discussions on version control, and could not resolve it. Could some kind person please assist me with this? Many Thanks!
You just need to specify the scope of 'cin' , 'cout' , etc. as i'm also facing the same issue... By using this,
std::cin>>tt;
You'll be able to resolve the issue.
define cin as std::cin
define cout as std::cout
210912281 See the Macros.
So, it does seem like this error should not be happening. However, I searched it up, and it seems as if it was a problem in VS Code 2017. If you use VS2019 instead of VS2017, it might work. If that doesn't work, go to this website: https://learn.microsoft.com/en-us/answers/questions/208835/cin-cout-and-other-functins-becomes-ambiguous-in-v It gives this answer: "When this happens, have you tried rescanning the solution rather than closing and reopening the file?
Rescan should be found under the Project menu, and also on the popup menu when you right-click on the source window in the IDE.
Sometimes the database used by Intellisense doesn't get updated automatically and promptly after some changes in the source. A Rescan forces that to happen."
If this doesn't work either, I'm not sure what you can do.
Facing this issue as well seems like its some bug in the latest release discussion
I was facing the same issue. One work workaround I found for this was to go to VS Code Settings (Ctrl + ,) and then search for "Error Squiggles", select "enabledIfIncludesResolve" and then restart your VS Code.
Attaching a Screenshot here as well: https://imgur.com/kZKT0mz
if you have c/c++ extension try installing 1.15.4 version by right clicking on extension and select install another version hope it helps for more reference- https://github.com/microsoft/vscode-cpptools/issues/11122#issuecomment-1604628221
I though maybe my c++ compiler might not be installed properly, didn't expected it to be a bug in vscode instead lol
Install Sublime Text
Restart the vs code
I have had this error multiple times and this always works for me
I still get this bug sometimes; often, deleting the line
#include <bits/stdc++.h>
, leaving it for a while, then adding it back in solves the problem.still facing same issue. Any update about this bug ???
Include Header file
#include<istream>
and#include<fstream>
Just Reload/Restart VS CODE. The C++ Extension Couldn't Properly Load That's why you are facing this problem.
I was having same problem. Extension was recommending that I should reload. I just reloaded VS Code and problem got fixed.
I am also facing this problem since a few days. I think it's a problem with VS code.
ok so I got to the root of why this happens,
C++ IntelliSense
f*cks up and causes this error.Solutions
Restarting the VS Code should solve it as extension reloads
Best Solution: You can hover on the
{}
icon on the bottom right and clickRescan
so that the IntelliSense updates again.I say it again Install Sublime Text
Why sublime, why not vscode? I use vs code and for me I think it is one of best ide for development as well as for competitive programming.