Question: I have a problem. The concept of Object Oriented Programming in C got homework. I need to use variadic functions. But I get a mistake. I'd appreciate it if you could help me. I'm new to encoding.

RastgeleKarakter.h : 

```
#ifndef RASTGELEKARAKTER_H
#define RASTGELEKARAKTER_H
struct RASTGELEKARAKTER{
// code
};

RastgeleKarakter SKarakterOlustur(int...); // prototype
void Print(const RastgeleKarakter);
#endif

```

RastgeleKarakter.c : 

```
#include "RastgeleKarakter.h"
#include "stdarg.h
RastgeleKarakter SKarakterOlustur(int... characters){
//code
}

```

Error :

```
 make
gcc -I ./include/ -o ./lib/test.o -c ./src/Test.c
In file included from ./src/Test.c:3:0:
./include/RastgeleKarakter.h:17:38: error: expected ';', ',' or ')' before '...' token
RastgeleKarakter SKarakterOlustur(int...);

```

I don't know how many parameters there are. I want to solve this with the variable function.

Answer: 
So my solution was to simply check if the user was already authenticated in my `[HttpGet]` login controller as opposed to my `[HttpPost]` login controller.

```
[HttpGet]
public ActionResult Login()
{
    if (User.Identity.IsAuthenticated)
        return RedirectToAction("Index", "Dashboard");

    return View();
}

[HttpPost]
public async Task<IActionResult> Login(LoginViewModel req)
{

    return View(req);
}

```
Implement Authentication.
And make Dashboard default controller. Magic will happen, out of the box. 

In Startup.cs

```
public void ConfigureServices(IServiceCollection services)
{

...

services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
         .AddCookie("user_by_cookie", options =>
         {
             options.LoginPath = "/Login/Index/";
         })
...

}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
 app.UseAuthentication();

 app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Dashboard}/{action=Index}/{id?}");
 });
...
}

```

Login Controller

```
    [Authorize(AuthenticationSchemes = "user_by_cookie")]
public class LoginController : Controller
{

    [HttpGet]
    [AllowAnonymous]
    public IActionResult Index()
    {
        return View();
    }

    [HttpPost]
    [AllowAnonymous]
    public IActionResult Index()
    {
        ...
        //authenticate();
        ...
        return View();
    }

    [HttpGet]
    public IActionResult Logout()
    {
        ..
        // logout();  -> 
        ..
        return RedirectToAction("Index");
    }

}

```

in Dashboard Controller 

```
    [Authorize(AuthenticationSchemes = "user_by_cookie")]
public class DashboardController : Controller
{

    [HttpGet]
    public IActionResult Index()
    {
        return View();
    }

}

```