TopN
TopN
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
thanks
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
my bad im stupid
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
It didnt give me an error but because i didnt call it it just gave me what type it returned
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
i got confused because it seemed to be working
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
im dumb
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
thats why
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
Yeah
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
Program.cs
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
for the picture
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
Here, let me give you the previous code i used
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
Alright
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
for the last code i gave u
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
This is still what it gives out with a string now
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
yeah i know i changed it a bit
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
i changed it a bit to test it with the name
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
it returns a func something string
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
and even with the name my problem is that
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace ObjectAndClasses
{
internal class food
{

//member variables
private string _name;
private int _heal;

//constructor method
public food(string name, int heal = 0)
{
_name = name;
_heal = heal;
Console.WriteLine("\nA new food called "+ _name + " was created!");
}

//member methods
public void eat()
{
Console.WriteLine("\nEating {0}!", _name);
Console.WriteLine("\nIt healed {0} healthpoint(s)!", _heal);
}

public void stop()
{
Console.WriteLine("\nStopped eating {0}!",_name);
}

public void info()
{
Console.WriteLine("\nThe food {0} heals {1} hp.",_name,_heal);
}

public string getName()
{
return _name;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

namespace ObjectAndClasses
{
internal class food
{

//member variables
private string _name;
private int _heal;

//constructor method
public food(string name, int heal = 0)
{
_name = name;
_heal = heal;
Console.WriteLine("\nA new food called "+ _name + " was created!");
}

//member methods
public void eat()
{
Console.WriteLine("\nEating {0}!", _name);
Console.WriteLine("\nIt healed {0} healthpoint(s)!", _heal);
}

public void stop()
{
Console.WriteLine("\nStopped eating {0}!",_name);
}

public void info()
{
Console.WriteLine("\nThe food {0} heals {1} hp.",_name,_heal);
}

public string getName()
{
return _name;
}
}
}
29 replies
CC#
Created by TopN on 6/23/2023 in #help
❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
This is food.cs (the class I created)
29 replies