How do I define an element of a struct in C? [closed]

1

I want to make a program that uses structs to store data, but that there is already some data inserted in it, I'll give a similar example:

struct registro
{
    char nome[30], telefone[11];
    int idade
}dados;

In case I would need to do something like:

dados[2].nome="José";

So that the program has a base in it, being able to insert new data or look for existing ones, however I did not find anything on the internet that explains how to do this and I also could not find any solution. Can anyone help?

    
asked by anonymous 06.06.2018 / 21:13

1 answer

1

I was able to solve my problem, in case I used a command from the library

strcpy(dados[1].nome, "José");
    
06.06.2018 / 22:35