Hey guys... its the newbie again :) I'm putting together a program that will calculate the area of either a triangle or a square and then prompt the user whether they wish to calculate another. I've got the code working to the point that it will calculate the area of either shape, but then doesn't continue with the rest of the code. F...
What well known C/C++ libraries are out there that could allow one to implement servlets, or at least provide most of the essentials for dealing with HTTP/CGI protocols such as http headers, error codes, cookies, GET/POST etc.
So far I have only found CPPSERV.
EDIT: Looking for server side solutions.
...
ok I'm trying to compile a simple kernel module, when I point to any of the below that contain includes, it complains about all kinds of stuff.
linux-headers-2.6.31-21 linux-headers-2.6.31-22
linux-headers-2.6.31-21-generic linux-headers-2.6.31-22-generic
linux-headers-2.6.31-21-generic-pae linux-h...
Edit: Forget it. it was another part of the code (actually the problem was a secondary element. another pointer but not allocated with malloc, just declared, so i think the memory was allocated in another place). the example now can compile.
thanks guys. im sorry for my typos but english isnt my native language(isnt a good escuse but i...
Hi everyone,
As an experiment i am trying to write the following program which allows me to generate code during runtime. i.e. i do the following:
1. Fill a buffer with op-codes of the instructions i want to execute.
2. Declare a function-pointer and make it point to the start of the buffer.
3. Call the function using the above func-pt...
void foo(int a)
{ printf ("In foo, a = %d\n", a); }
unsigned char code[9];
* ((DWORD *) &code[0]) = 0x042444FF; /* inc dword ptr [esp+4] */
code[4] = 0xe9; /* JMP */
* ((DWORD *) &code[5]) = (DWORD) &foo - (DWORD) &code[0] - 9;
void (*pf)(int/* a*/) = (void (*)(int)) &code[0];
pf (6);
Anyone knows where in the ab...
I have some C code that I have to port to C++. The code has a structure
struct A {
...
struct A * myPtr;
}
And now two global arrays are declared and initialized like this:
//Forward declaration of Unit
struct A Unit[10];
struct A* ptrUnit[2] = { Unit, Unit+7 };
struct A Unit[10] = { { .., &ptrUnit[0] },
...
Say in a statement like this
char var;
if( var == 'x');
Do we allocate any memory for 'x' at first place?
If yes, which is it (stack/data)?
Thanks!
...
I know the MESI protocol is used to implement cache coherence in multiprocessor systems. But I don't know how its implemented. Any help on this is very much appreciated.
...
Hi all,
I'm trying to implement a ring buffer with the following struct
/*head, tail are indexes of the head and tail of ring buffer
*count is the number of elements; size is the max size of buffer
*rbArray is an array to pointer of char used to store strings
*/
struct rb{
int head;
int tail;
int count;
int size;
char...
I Want to access the COM port present in the remote system from system. Any help would be appreciable.
I am using windows XP in both remote as well as local system.
...
I want to debug one api call of dll?
It is written in C language.
I do not know the calling process,so I need to write one process which can call api of above dll?
I am using VS 2005.
Can I get help for the same?
...
I have a program that is running slower than I'd like it to.
I've done some profiling, and I've found the section that is taking up the vast majority of processing time
DO K = 0, K_MAX
WRITE(EIGENVALUES_IO, *) K * 0.001 * PI, (W_UP(J), J=1, ATOM_COUNT)
DCMPLXW_UP(:) = DCMPLX(W_UP(:))
DO E = ...
I'd like to copy and call a function, but the code below segfaults when calling the buffer. What do I have to change? (Linux, x86)
#include <string.h>
#include <malloc.h>
#include <stdio.h>
int foo () { return 12; }
void foo_end () {}
int main () {
int s = (unsigned long long) foo_end - (unsigned long long) foo;
int (*f) () = (int...
#include <stdio.h>
double IncomeTAX(double i)
{
double tax;
if(i <= 120000)
tax = 0;
else
tax = (i - 120000) * 15/100;
return tax;
}
int main(void)
{
double a, b;
printf ("Enter the annual income: ");
scanf ("%lf", &b);
a = IncomeTAX(b);
printf ("I...
In the Call Stack window of visual studio, it reports:
[Frames below may be incorrect and/or missing, no symbols loaded for IPCamera.ax]
What does it mean by Frames, and why missing symbols may cause it incorrect?AFAIK,symbols are just for debugging info,missing symbols will only make the source invisible .
...
Hi,
I want to debug a "big" C code, and use valgrind, in particular the tool memcheck. The output is very long, due to the size of the program, and I only want to focus on some function and relative subfunctions of the program. Is it possible in valgrind only to analyze certain function and subfunctions (up to some depth level)?
Thanks...
I have a program that I link with many libraries. I run my application on profiler and found out that most of the time is spent in "waiting" state after some network requests.
Those requests are effect of my code calling sleeping_function() from external library.
I call this function in a loop which executes many, many times so all waiti...
Hey,
I have major issue with GNU gdb (GDB) SUSE (6.8.50.20090302-1.5.18).
It takes ages to print the value of a nested symbol and hitting Ctrl-C has no effect.
Do you know the reason? Is there any workaround?
Thanks
...
Hi,
How can I make a copy of a tree data structure in memory to disk in C programming language?
...