Say I have some windows method and a struct:
struct SomeStruct{
int foo;
int bar;
int baz;
int bat;
}
SomeMethod(int a,int wParam, int lParam)
{
SomeStruct s;
// get lParam into SomeStruct
}
How to I ... |
I have a struct sockaddr and need to make a struct addrinfo (specifically that, because that's what some other API wants). The IP address may be IPv4 or IPv6. What's the ... |
I have the following code:
int main(void)
{
struct { int x; } a, b;
struct { int x; } c;
struct { int ...
|
I'm just wondering if anyone has already created a tool that will take a given JSON string and write the code for an identical struct in C along with the parser ... |
just wondering if I have a struct in_addr,
how do I convert that back to a host name?
|
Can somebody help me convert an X509 certificate to the x509 structure format (like in Openssl)
I have to get the tbscertificate field (present in x509 ASN1 DER notation) in MPLAB from ... |
What is the right way to malloc memory ? And what is the difference between them ?
void parse_cookies(const char *cookie, cookie_bank **my_cookie, int *cookies_num)
{
*my_cookie = malloc(sizeof(cookie_bank) * 1);
...
|
|
I'm trying to convert this C code to C#, is there a C# equivalent to the C union typedef?
struct sockaddr_in {
short sin_family;
...
|
window->currentFamily->index = filePtr; If window is null or uninitialized -> Crash If currentFamily is null or uninitialized -> Crash index is the same type as filePtr?? Yes? Otherwise, the code probab;y won't compile. Now you say an exception is thrown at run time. The code you show is not going to throw an exception. Bad pointers don't do that, they just ... |
Hello, I have the following problem: a have a lot of C structs and I'd like to: - generate a XML Schema from de structs definitions - generate a XML with the content of a group os this structs loaded with values Does anyone know some library which does this? Thank you in advance, Estevao Rohr. |
|
Hi Folks, I'm developing a software tool that can create the basic software outline (classes, modules, functions) from natural language (i.e. English.) After that programming in for example C/C++/C# can start. The whole idea is that you can start with a super simple 'problem definition file' in normal language, for example English, which you should alway make and begin with. From ... |
sorry it said i couldnt initialize it in the same way if it was type string. and that was the error message. those were the only two lines. i didnt know i couldnt assign "a string" to char[] =D. i just got problems getting the whole char* and now char[] deal. thanks for the help i get that char[] only prints ... |
|
|
TRIAD, your question should be "how do i calculate a checksum" .... NOT "how do i convert a struct to a short". the quick answer, is that you take your entire header and divide it into 2-byte "words", along their natural 16-bit boundaries, and perform a 1's complement addition on each word for a total checksum that is itself a 2-byte ... |
I'm triyng to use this function int result = NativeMethods.midiOutGetDevCaps( -1, ref pSI, (uint)Marshal.SizeOf(pSI) ); Docs say that pSI is a struct (below) [c++] typedef struct { WORD wMid; WORD wPid; MMVERSION vDriverVersion; CHAR szPname[MAXPNAMELEN]; // Here's the problem WORD wTechnology; WORD wVoices; WORD wNotes; WORD wChannelMask; DWORD dwSupport; } MIDIOUTCAPS; This is my code in c# [C#] public struct MIDIOUTCAPS ... |