Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
struct MyStructure obj = { 0 };
while (a == b)
{
// igendwas
memset(&obj, 0, sizeof(struct MyStructure));
}
while (a == b)
{
struct MyStructure obj = { 0 };
// igendwas
}
Huh? Egal. Der Compiler schmeißt so was eh raus.Ich hab jetzt ne funktion was einfach nen leeres struct zurück gibt.
struct config getCleanConf() {
struct config conf = {
.Id = 0,
.Type = "",
.fb_name ="",
.fb_hw = "",
.fb_major = 0,
.fb_minor = 0,
.fb_patch = 0,
.fb_build = 0,
.fb_type = "",
.fb_serial = "",
.fb_oem = "",
.fb_lang = "",
.fb_country = "",
.fb_annex = "",
.fb_flags = "",
.fb_updateconfig = 0,
.fb_provider = "",
.fb_provider_name = "",
.update_url = "",
.update_info_url = "",
};
return conf;
}
struct config conf = { 0 };
sind alle deine Member die du aktuell mit "" initialisierst keine Pointer sondern Arrays
Alle Member werden komplett ausgenullt.
Der Funktionsaufruf im Code wird genauso lang wie die eigentliche Initialisierung.
In dem Fall:Ja und bei Typ kommt mir das ungelegen.
struct config conf = { 0, "irgendeintyp" };