+ 1
Default sample programs in C# lessons return errors.
Just started learning C#, and when I run the sample programs accompanying the lessons without any modification of my own (I emphasize this), I get a long error starting with: ..\Playground\:1:7: error: expected nested-name-specifier before âSystemâ xxx using System; where xxx is some weird string of special characters. The actual error message is much longer but I am not reproducing the entire message. Programs that worked at first are not working any more.
3 Answers
+ 1
Hi. Firstly share your code, and let me know when it will be shared.
0
As stated earlier, they are not my codes. They are the ones provided in the lessons. For instance, please go to Learn -> C# Tutorial -> Comments and click the âTRY IT YOURSELFâ link. Itâs the default sample code provided within the lesson itself, with no modification of my own. Please note, this for some reason happens only on the iPad and iPhone app versions. On the web version of Sololearn, the same sample code runs fine.
Edit: Why don't I just type the code here.
âšâšâšusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{static void Main(string[] args)
{
//Prints Hello
Console.WriteLine("Hello");
}
}
}
The following is a link to the screenshot of the code and a portion of the error in the output field.
https://photos.app.goo.gl/OeeIzP6Z6AvZo2B83
Edit: Forget it, I updated the iPad app to the latest version of SoloLearn app which was pushed out 4 hours ago as of this editing, and it seems like the codes are working again. Probably something wrong with the iPad app itself, rather than the code.
0
Since the compiler implies, there is a problem with the list. The list is not accepted as is by the compiler in this case. It can be compiled as std::list.
As is common knowledge, if utilizing namespace std is not used in our program, we may encounter an error stating that cout was perhaps not declared in this scope. However, we are aware that in the past, the using namespace std in the program was not necessary. But as of right now, we must use it or cout as std::cout.
The cause in the software mentioned above is somewhat close to this rationale.
Read More:https://kodlogs.net/214/error-expected-nested-name-specifier-before-namespace-fixed