Unfortunately, the struct definition is part of the SDK. I really don't know how that field gets initialized. I guess I could do a memcpy over the entire struct, but that's not a very clean solution.
I'm guessing this must be some sort of compiler extension, unless somebody else has a better idea. Your code is very C-like, not C++-like. Do you know what compiler this SDK recommends, and do you have any links to documentation for this SDK?
Edit: Actually there might be a way to this. I'm trying something out. I would still like a link to the documentation.
Your observation about this being C-like is spot-on. I only asked here because this forum seems to know the answer to just about everything.
The SDK is really the Espressif IDF. They use a compiler for the xtensa architecture, but I don't think they added any functionality that would cover this oddity.
Okay, thanks. But before we go digging into that, I think my struct casting bypasses the issue of the const array. You should try it out at some point and let us know if it works.
Have you considered using the manufacturers forums for answers to your questions?
Also most embedded processor companies have data sheets available for their different processors that sometimes contain sample code that may be similar to what you are trying to do.
Without knowing the exact piece of hardware and the exact processor it is going to be hard to give solid answers, will also need to know your build system OS.
I will indeed use the mfg. forum for this; I just thought I'd try here first.
FWIW, I'm 99% sure that this isn't some special feature they built into their compiler. It *could* be part of their build system, but I doubt that as well. I've looked through the source for their IDF and can't find an instance of where they populate this struct...really weird.
You're really not providing enough information to get any meaningful answers.
but I get a couple errors, about missing braces, and initializing a char from a char *. Can someone tell me what I'm doing wrong?
You need to post the complete error/warning messages, exactly as shown in the development environment. Compiler error messages usually have important information embedded within the text so you need to show the complete error message (all of them since one problem can generate multiple error messages).
You are also not providing near enough code, on something like this you would probably be better off posting the smallest possible complete program that illustrates the problem.
FWIW, I'm 99% sure that this isn't some special feature they built into their compiler.
Actually I would disagree. This code appears to be part of an HTTP: service which while not really "special" it is a feature of the SDK, not necessarily a compiler feature.