Given the size of the code of the main function in bytes passed as a parameter to a function, what is the best way to get to the base address for the main code and retrieve the first char * in the argv array?
...
I want to use this function to get contours and within these contours, I want to get cubic bezier. I think I have to call it with GGO_BEZIER. What puzzles me is how the return buffer works.
"A glyph outline is returned as a
series of one or more contours defined
by a TTPOLYGONHEADER structure
followed by one or more curves. Eac...
Is this from the C standard?
...
Hi All,
I am programming C on cygwin windows. After having done a bit of C programming and getting comfortable with the language, I wanted to look under the hood and see what the compiler is doing for the code that I write.
So I wrote down a code block containing switch case statements and converted them into assembly using:
gcc -...
hi,
AFAIK, string literals are stored in read only memory in case of C language.
where is this actually present on the hardware.
as per my knowledge heap is on RAM.correct me if i am wrong.
how different is heap from read only memory?
is it OS dependant?
...
Hi,
I have a little problem. I need to do some little operations on quite many files in one little program. So far I have decided to operate them in a single loop where I just change the number after the name. The files are all named TFxx.txt where xx is increasing number from 1 to 80. So how can I open them all in a single loop one aft...
Short Question
What's the right way to handle a Ctrl-C event sent over Telnet on the server side?
Long Question
After calling recv() on a socket, I'd like to handle some situations appropriately. One of them is to return a certain error code when Ctrl-C was received. What's the correct way to detect this? The following works, but it ju...
I am studying COM. I think the best way to get a thorough understanding of COM is write one without any COM framework such as ATL. I have written a COM server in raw C++, and now I want to write one in plain raw C. How could I do this? Is there any tutorial?
Many thanks.
...
I have a c++ application linked against some c libraries.
Are there possible approaches to encapsulate the signal handling in a C++ class, so it could be handled as a c++ exception?
...
I'm trying to convert some code from Javascript to c. The function creates an array (which always has a fixed number of items) and then returns the array. I've learned that in c it's not straightforward to return an array, so I'd like to return this as a struct instead. My c is not all that great, so I'd like to check that returning a st...
Hi all,
In Ubuntu, I am running 2 'C' applications, When I press key up/down the applications are alternatively getting the events. What might be the problem/solution?
Ex: I have 'A application' and 'B application', I launch 'A application' and press the key up/down its working fine. If I simultaneously launch 'B application' and focu...
Having tried this
int main(void) {
int a[10];
a[20]=5;
}
gcc -Wall -O2 main.c
It gives me no warning...
It's gcc within windows (mingw) and I am not able to detect this kind of boundary limit bug
how to tell compiler to check it? can mingw do it?
thanks
...
It's the same syntax in a way too many languages:
switch (someValue) {
case OPTION_ONE:
case OPTION_LIKE_ONE:
case OPTION_ONE_SIMILAR:
doSomeStuff1();
break; // EXIT the switch
case OPTION_TWO_WITH_PRE_ACTION:
doPreActionStuff2();
// the default is to CONTINUE to next case
case OPTION_TWO:
doSomeStuff2()...
Hi,
How can i create a temporary folder in tmp folder using C++ language.
Edited:
This is my code but is showing an error.
Actually, i have 3 volumes. Leopard, Development and 10.6 (in Mac OS X) and i want to create a temp directory in current home directory.
Here is my code,
// i am confused about this line char* tempdir = "/Volu...
Gentoo Wiki told me the following:
Warning: GCC 4.2 and above support
-march=native. -march=native applies additional settings beyond -march,
specific to your CPU. Unless you have
a specific reason not to (e.g. distcc
cross-compiling), you should probably
be using -march=native, rather than
anything listed below.
What a...
Hi folks,
I know this is a mater of taste, but actually I cannot accept the Objective-c syntax.
Any advices so that I can go ahead and learn this language with this freak syntax?
Thanks.
...
Hi
I have a BIOS function I need to call from time to time on an embedded system, and using LRMI I was able to call it successfully from a user space program. Now I want to do the same from a loadable kernel module.
Is there any way to do this? Some other library maybe?
...
This is a classical problem, but I can not find a simple solution.
I have an input file like:
1 3 9 13 23 25 34 36 38 40 52 54 59
2 3 9 14 23 26 34 36 39 40 52 55 59 63 67 76 85 86 90 93 99 108 114
2 4 9 15 23 27 34 36 63 67 76 85 86 90 93 99 108 115
1 25 34 36 38 41 52 54 59 63 67 76 85 86 90 93 98 107 113
2 3 9 16 24 28
2 3 10 1...
Hello people,
i've been working for a few days with this server using select(). What it does, is that, i have two arrays of clients (one is "suppliers", and the other is "consumers"), and the mission of the server is to check whether the suppliers have something to send to the consumers, and in case affirmative, send it.
The second par...
Is there any way to know if you program has undefined behavior in C++ (or even C), short of memorizing the entire spec?
The reason I ask is that I've noticed a lot of cases of programs working in debug but not release being due to undefined behavior. It would be nice if there were a tool to at least help spot UB, so we know there's the...