基本上,我只是用Malwarebytes扫描了我的计算机(在运行之前更新了定义),并说它用C#编写的"helloworld"程序有一个木马.
我知道这是一个误报,因为我只在2-3天前编写了该程序,并在一个小型教程网站上制作了我信任的程序.我是C#的新手,但我看不到任何可以发出木马警告的东西.

程序标记可执行文件,但不标记源文件.
using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("\n\tHello World!");
Console.WriteLine("This is my first C# program.\nI'm so proud of myself!");
Console.WriteLine("\tTeehee!");
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是用Notepad ++编写的代码,它是从命令行运行的(实际上是Cygwin).为什么会标记这个?作为一个崭露头角的C#程序员,我应该知道这件事吗?
我正在尝试编写一个简单的链表,并且当用户想要一个超出范围的节点索引时,我试图抛出一个out_of_range异常.但是,当我编译源文件时,我收到错误"'out_of_range'不是'std'的成员".
我的理解是'out_of_range'是std ::的成员,所以我假设我做错了,我不知道.
这是发生错误的地方:
T getValueAtIndex (int index)
{
// If the index is less than 0 or greater than/equal to
// the length, throw index out-of-bounds exception.
if (index < 0 || index >= length)
{
throw std::out_of_range ("Index out of bounds.");
}
else
{
// Start at index 0.
int i = 0;
// Start with the first node in the list (headNode).
Node * currentNode = headNode;
// While we have not yet reached the index we …Run Code Online (Sandbox Code Playgroud) 我对编程比较陌生,最近开始学习Java以便进入Android编程.我以为我会创建一个非常简单的计算器来练习,但似乎我的if语句不起作用.
import java.util.Scanner;
public class Calculator {
public static void main(String[] args) {
//Create new scanner object
Scanner numInput = new Scanner( System.in );
//Enter first number
System.out.println("Please enter the first number: ");
int num1 = numInput.nextInt();
//Enter the second number
System.out.println("Please enter the second number: ");
int num2 = numInput.nextInt();
//Choose the operation to perform (+,-,*,/)
System.out.println("What operation would you like to do?");
System.out.println("Type \"+\" to add.");
System.out.println("Type \"-\" to subtract.");
System.out.println("Type \"*\" to multiply.");
System.out.println("Type \"/\" to divide."); …Run Code Online (Sandbox Code Playgroud)