description: Python can loop functions in eachother. can cS loop function too?
Example python:
def func():
x=input(">")
func()
Example c# expected:
namespace f
{class f{
static void main(string[] args){
void stuff() {
Console.readLine()
stuff()
}
}
}}
i dont think its possible to loop function in the function in cs.
what i mean by looping function is by putting the void inside the container. here is what i mean python:
def g():
x=input(">")
g()
output (typer):
Python Latest Update
>h
>bruh
>new line
>new new line
>line
>infinite input lines
> repeating function
i use this because in python i added commands in the script and i do it so i wont need to retype until the python stops the input.
example:
Problem (python script):
def func():
x=input(">")
if x=="help":
print("commands: help")
x=input(">")
if x=="help":
#repeat
Solution (python script):
def func():
x=input(">")
if x=="help":
print("commands: help")
func()
why i put the examples in python script: idk if you can do this in c# so im not going to confuse anyone
Can this happen in C#?
>Solution :
I’m not familiar with C# but hopefully this page can help Recursive Function C#
What you’re trying to make is called a recursive function