My main experience is with C && C++, so I'd prefer to remain with them. I don't want to use anything like QT, GTK, or wxWidgets or any tool kits. I'd like to learn native programming and this sort of defeats the purpose. With that in mind I'd also like to avoid Java.
I understand gnome and xfce and KDE and such are all Desktop Environme...
I want to to create a window not sizable and without caption like vista sndvol.exe
DlgSimpleVolume
...
I ask because I am sending a byte stream from a C processto Java (through a priority middle ware). On the C side the 32 bit integer has the LSB is the first byte and MSB is the 4th byte.
So my question is on the Java side when we read the byte as it was sent from the C process, what is endian on the Java side?
A follow up question if t...
I have a structure that contains an arrays of another structure, it looks something like this:
typedef struct bla Bla;
typedef struct point Point;
struct point
{
int x, y;
};
struct bla
{
int another_var;
Point *foo;
};
I now want to initialize them in the global scope. They are intended as description of a module. I tr...
Dear all, Here are my questions...
1- Do realloc and memcpy copy the entries in an array to another in a way faster than just iterating on each element O(N) ? If the answer is yes then what do you think is its complexity ?
2- If the size allocated is smaller than the original size, does realloc copy the entries to somewhere else or jus...
I’m attempting to check the rights on a particular file for a specific
trustee and am using the win32 API GetEffectiveRightsFromAcl(). When
the file is accessible by a domain group, the function
returns 5 (Access Denied) when a local account (admin or other) is
used to execute the function.
These three statements summarize the behavior...
Can the alignment of a structure type be found if the alignments of the structure members are known?
Eg. for:
struct S
{
a_t a;
b_t b;
c_t c[];
};
is the alignment of S = max(alignment_of(a), alignment_of(b), alignment_of(c))?
Searching the internet I found that "for structured types the largest alignment requirement of any of i...
I am restricted to C (cannot use C++). I wish C had stricter type checking.
Is there a way to get compile errors on the commented lines? If it helps, the enum values cannot overlap.
enum hundred {
VALUE_HUNDRED_A = 100,
VALUE_HUNDRED_B
};
enum thousand {
VALUE_THOUSAND_A = 1000,
VALUE_THOUSAND_B
};
void print_hundre...
I've written an Apache module in C. Under certain conditions, I can get it to segfault, but I have no idea as to why. At this point, it could be my code, it could be the way I'm compiling the program, or it could be a bug in the OS library (the segfault happens during a call to dlopen()).
I've tried running through GDB and Valgrind with...
What is the accepted/most commonly used way to manipulate dynamic (with all dimensions not known until runtime) multi-dimensional arrays in C and/or C++.
I'm trying to find the cleanest way to accomplish what this Java code does:
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int rows=sc.nextInt();
int co...
I know how they are different syntactically, and that C++ uses new, and C uses malloc. But how do they work, in a high-level explanation?
See http://stackoverflow.com/questions/240212/what-is-the-difference-between-newdelete-and-mallocfree#240308
...
I'm creating a set of enum values, but I need each enum value to be 64 bits wide. If I recall correctly, an enum is generally the same size as an int; but I thought I read somewhere that (at least in GCC) the compiler can make the enum any width they need to be to hold their values. So, is it possible to have an enum that is 64 bits wide...
What is a good C/C++ CSS parser? All that I can find is CSSTidy, and it seems to be more of an application than a parsing library.
...
I am not understanding the point of using .def files with DLLs.
It seems that it replaces the need to use explicit exports within your DLL code (ie. explicit __declspec(dllexport)) however I am unable to generate a lib file when not using these which then creates linker issues later when using the DLL.
So how do you use .defs when lin...
Hi,
Can anyone send me a c code to divide 2 64bit numbers. My compiler only supports 32/32 division.
Thanx & Regards
Mani
...
Which is the best book on Data structures to refer to?
...
I'd like to create an abstraction in OpenGL of the environment settings(blending, stenciling, depth, etc.) that works like the matrix stack. Push onto the stack, make any changes you need, draw your objects, then pop the stack and go back to the prior settings.
For example, currently you might have drawing code like this:
glEnable(GL_B...
I'm using dlopen() in an Apache module that I am writing so that I can have a plugin system for my module. I've found that if I compile my module, compile my plugin, and start Apache, everything works peachy-keen.
If, however, after I have done all that, I recompile my plugin, (making a small change or two to the plugins code,) my next ...
How to call a name-mangled symbol from C?
module.name:version
void* function(TypeSig); // Type of the function
I'd want to be able to use codepaths written in my language in C. The function calling convention is about the same. It's just that I must mangle in the version and the module path inside the symbols I export, and I have the...
Is it possible to implement RAII in pure C?
I assume it isn't possible in any sane way, but perhaps is it possible using some kind of dirty trick. Overloading the standard free function comes to mind or perhaps overwriting the return address on the stack so that when the function returns, it calls some other function that somehow relea...