Defining a class or struct for use between multiple scripts

Let us say I have two scripts: A and B.
I want to be able to use a class or struct between them, for example:

class C
{
    // some definition
    int val;
}

file A.cs

public class A : MonoBehaviour
{
    public DoSomething(C inC)
    {
    // do something
    }
}

file B.cs

public class B : MonoBehaviour
{
    public A a;
    public Update()
    {
        C c;
        c.val = 3;
        a.DoSomething(c);
    }
}

So my questions are: where should I define C? what should I do so that A and B will be able to use it? would I have to do anything different if I define C as a struct?

create a file c.cs thats in the same folder or in a script folder thats compiled before

thats it

With structs that won’t work, in that case you need to put it into a file of another class that meets above requirements.