Let me explain what I'm trying to realize:
I have a encrypted tar file. I can decrypt it in memory, but obviously I can't write the decrypted data back to hard disk as a real file. The decrypted data is structured as a char* buffer in memory; how can I untar it in memory?
I can't find answer with libtar library.
I also tried to untar i...
when i compile lex.yy.c with lfl gcc recognizes that some .a file of the flex library might be needed to be linked with my code. similarly for yacc we specify the -ly compiler option.
in other words if i create a library, abc.a i want gcc to recognize that whenever a program is compiled with -labc it should link with the library abc.a. ...
I am writing an IPC application using message queues. While using msgget() function to get Message Queue I am getting this error.
The requested operations does not require lot of space on the device and there should be space left as well.
Any ideas. Thank you in advance
...
What is the best and easiest method to debug optimized code on Unix which is written in C?
Sometimes we also don't have the code for building an unoptimized library.
...
Hello All,
I have implemented the client server using socket programming in C on Unix OS. I have used the non blocking socket at client end. I want to implement the two way communication. But its working only with one way i.e. Client can read and write the data on server, but server can not read or write data on client.
Client
nread =...
I am trying to create a matrix with dynamic proportions and to initialize it
here is the code I am using to allocate memory and initialization:
int **matrix;
//mem allocation
matrix=(int*)malloc(sizeof(int*)*mat_w);
for (i=0;i<mat_w;i++)
matrix[i]=(int)malloc(sizeof(int)*mat_h);
//init
for (i=0;i<mat_w;i++)
for (j=0;j<mat_h;j++)...
I have a small inline assembly code written in my C code.
The asm goes through an array and if needed, move values from a different array to a register.
In the end, an interrupt is called.
The code is similar to this:
cmp arrPointer[2],1h
jne EXIT
mov AX, shortArrPtr[2]
EXIT:
int 3h
This all work in x86 but according to microsoft: x64...
Hello,
I'm new at Bison, but in C/C++ no and at this time of development and regular expressions i never heard something like this, only the \n that's used for a new line, but i want to know what is the explanation of \t%.10g, that in the code is like this:
line: '\n'
| exp '\n' { printf ("\t%.10g\n", $1); }
;
Best Rega...
I want to write a very simple C program on AIX to return the value of the system's wait queue as displayed in the 'topas' tool. I can't seem to locate a simple system reference that shows how to do this.
...
I have the following definition.
far int* near IntegerPointer;
Does this mean, a pointer placed in 'near' memory pointing to a integer placed in far memory area.
Can anyone please clarify.
...
I wanted to take character array from console and it also include white spaces, the only method i know in C is scanf, but it miss stop taking input once it hit with white space. What i should do?
Here is what i am doing.
char address[100];
scanf("%s", address);
...
I have a little bit of experience in c/c++ from college but have not worked in it for years. What sorts of things do I need to know to even be considered for a c/c++ job position?
...
gah..!! Forgot basics...some how this free is not working, i ran program on windows and followed memory usage using task manager, which didn't show any reduction in memory usage after free statement.
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int i=0,j,k;
char **ptr;
ptr...
We have a native app that we can access via JNI->DLL or by invoking an EXE with command line parameters. Which would be the best approach?
We will be invoking this method about 100 times a day. Performance isn't super important. This native app was developed by a group outside of our company so we are not too familiar with the code (...
I am in the following situation:
I am writing code for a kernel that does not allow SSE instructions
I need to do floating-point arithmetic
I'm compiling for a x86_64 platform
Here is a code sample that illustrates the problem:
int
main(int argc, char** argv)
{
double d = 0.0, dbase;
uint64_t base_value = 300;
d = (2200...
I am using msgget() function in my IPC based application. How can I clean up the queue filled up with old message queues?
...
I need an efficient function that extracts first second and rest of the sentence into three variables.
...
I am porting some C code to a TI DSP chip environment. I'm grappling with the C compiler.
I have a data structure that includes a pointer to a function. I have a function that initializes the data structure. Something like this:
typedef void (*PFN_FOO)(int x, int y);
struct my_struct
{
PFN_FOO pfn;
};
init_struct(struct my_str...
I am trying to create and emit a GTK signal:
g_signal_new("child-finished",
G_TYPE_OBJECT,
G_SIGNAL_RUN_FIRST,
0,
NULL, NULL,
NULL, // *** I think this is where I need to change it
G_TYPE_NONE, 0);
g_signal_connect(G_OBJECT(myWindow), "child-finished", G_CALLBACK(MyCallback), NULL);
Here is my code th...
I'm trying to call popen() using mingw like this:
#define RUN_COMMAND "\"C:\\Program Files\\CA\\BrightStor ARCserve Backup\\ca_qmgr.exe\" \"-list\""
int main() {
outputPointer = popen(RUN_COMMAND, "r");
...
}
But I can't get it working.
I think it's a quoting nightmare ...
...