Skip to content

Instantly share code, notes, and snippets.

@ochsec
Last active October 25, 2023 22:24
Show Gist options
  • Save ochsec/7343813b13386da6c6ad535af212bebd to your computer and use it in GitHub Desktop.
Save ochsec/7343813b13386da6c6ad535af212bebd to your computer and use it in GitHub Desktop.

Revisions

  1. ochsec revised this gist Oct 25, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion McNull.cs
    Original file line number Diff line number Diff line change
    @@ -31,7 +31,7 @@ static void Main(string[] args)

    var emporersNewProp = mcNull.foo;

    // Print the values of the properties
    // Print the values of the emperorsNewProp
    Console.WriteLine("emporersNewProp: " + emporersNewProp);
    }
    }
  2. ochsec revised this gist Oct 25, 2023. 2 changed files with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.txt → McNull.cs
    Original file line number Diff line number Diff line change
    @@ -29,9 +29,9 @@ static void Main(string[] args)
    mcNull.baz.Add(2);
    mcNull.baz.Add(3);

    var emporersNewProp = mcNull.foo;

    // Print the values of the properties
    Console.WriteLine("foo: " + mcNull.foo);
    Console.WriteLine("bar: " + mcNull.bar);
    Console.WriteLine("baz: " + string.Join(", ", mcNull.baz));
    Console.WriteLine("emporersNewProp: " + emporersNewProp);
    }
    }
    File renamed without changes.
  3. ochsec created this gist Oct 25, 2023.
    37 changes: 37 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    using System;
    using System.Collections.Generic;

    class McNull
    {
    public string foo { get; set; }
    public int bar { get; set; }
    public List<int> baz { get; set; }

    public McNull(int aBar)
    {
    bar = aBar;
    baz = new List<int>();
    }
    }

    class Program
    {
    static void Main(string[] args)
    {
    // Create an instance of McNull with aBar = 42
    McNull mcNull = new McNull(42);

    // Set the foo property
    // actually, I forgot

    // Add some values to the baz list
    mcNull.baz.Add(1);
    mcNull.baz.Add(2);
    mcNull.baz.Add(3);

    // Print the values of the properties
    Console.WriteLine("foo: " + mcNull.foo);
    Console.WriteLine("bar: " + mcNull.bar);
    Console.WriteLine("baz: " + string.Join(", ", mcNull.baz));
    }
    }
    10 changes: 10 additions & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    </PropertyGroup>

    </Project>