I have made strcat() function myself but after adding the string it is printing an extra ascii symbol.
Please tell why?
#include<stdio.h>
#include<conio.h>
#include<string.h>
void xstrcat(char string1[],char string2[]);
void main(void)
{ char x[100];
char string1[40],string2[40];
printf("Enter a string:");
gets(string1);...
I am writing a server-client application in c and need to send some structures back and forth.
From what I have learned, it would be a good idea to use some library to serialize the structures as it then rids them off platform dependency.
I read about some xml based and binary based serialization methods, but I am not sure what library...
I have this code and I am not getting the expected results... whats wrong?
typedef struct {
int data1;
int data2;
}t;
void foo(int a, int b) {
Handle handle;
t arg;
arg.data1 = a;
arg.data2 = b;
handle = (HANDLE) _beginthread( myFunc, 0, (void*) &arg);
}
void myFunc(void *param) {
t *args = (t*) param;
int ...
I have a functioning implementation of a MPI routine, which works fine. In the process of making this a hybrid between MPI and shared memory, I am using pthreads. This in turn proofed the need of pthread_barriers.
But when I try to compile my code with the mpicc compiler, it complains over pthread_barrier_t and other barrier commands. ...
I have made a small application in C. It does some file manipulation, basically searches and changes some files names. But if it is used in Win Vista/7 in the program files folder the program says permission denied. Is there anyway to bypass this?
Also, can Java bypass this?
...
Right now i'm creating polygons with bezier handles. It's working well, except right now I always do something like this:
for(float i = 0; i < 1; i += 0.04)
{
interpolate A, a.handle to B.handle, B at time i
}
The problem is no matter how short the distance or long the distance between point A and B, it always produces the same amo...
I would like to create an open source alternative to Palm OS programs like Noviiremote and Omniremote.
I need to access the IR port of my Tungsten E2 and use it to transmit remote control type signals (I assume NEC and/or RC-5).
Are there any libraries out there I could use? If not, how do I go about transmitting raw codes via the IrDa...
Hey,
How do I install Eclipse for C
Please send links and helpful tips.
Thanks
Need an easy install
• Steps involved
• SDK with all the libraries and stuff I'll need
• Variable path setup
• Anything else that may surprise a noob
...
When development various platforms(Android,iPhone,Mac,Windows and so on), it is necessary diverged processing(#ifdef/#endif) by depends on an platform definition.
But, I don't know original definition in Mac/iPhone/Android.
Windows : WIN32 (Visual C++)
Mac : __MAC_NA(?) (XCode)
iPhone/iPad/iPod : __IPHONE_NA(?) (XCode)
Android :...
Using GCC, I am trying to add simple exception logic to this program. Ideally, a simple "if" would work well. IF the fopen succeeds then do x, if it fails do z. Is there a simple way to do this?
#include <stdio.h>
main()
{
FILE *ptr;
ptr = fopen("c:\\RedyBoot.bat","r");
fclose(ptr);
return 0;
}
...
Hello,
The goal is to run in a separate thread function downloads data from the main form.
To do this, use GIOScheduler.
I have function for loading data:
void load(GInputStream* input_stream, GCancellable* cancellable)
{
...
}
The function load works 100%. Then there is the function you want to send in a separate thread:
v...
I'm having some images, of euro money bills. The bills are completely within the image
and are mostly flat (e.g. little deformation) and perspective skew is small (e.g. image quite taken from above the bill).
Now I'm no expert in image recognition. I'd like to achieve the following:
Find the boundingbox for the money bill (so I can "c...
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
//char s[6] = {'h','e','l','l','o','\0'};
char *s = "hello";
int i=0,m;
char temp;
int n = strlen(s);
//s[n] = '\0';
while (i<(n/2))
{
temp = *(s+i); //uses the null character as the temporary storage.
*(s+i) = *(s+n-i-1...
I can find tons of examples in C++, but nothing that's written in just C. I am trying to connect to an http server, download the returned data, and then save it to a file. Is there a better way to do it on Windows? Should I not be using WinHttp or WinInet? Windows documentation for C seems to be extremely lacking on the internet. Thank y...
the formula is pretty complicated. the numerator is num and the denominator is den, in the formula there is a root on the denominator so i have putted den in sqrrt() but sqrrt only accepts doubles
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define LEN 11
// for the following set of x and y find r by the formula ..
float sum(fl...
If I'm compiling a C program with gcc, I can safely assume that the functions in regex.h are available. Is there a regex library I can assume is there if someone is compiling with microsoft's C compiler?
...
I am having trouble freeing a pointer in a pointer array (values).
typedef struct MyStruct{ char** values; }MyStruct;
In C, I create dynamic array.
JSDictionary **array = (JSDictionary **)malloc(sizeof(JSDictionary *) * numRows);
The resultSet should be an array of JSDictionary pointers. I create the struct like:
JSDictionary * ...
How to open file\live stream with FFMPEG edit each frame with openCV and save that as encoded with FFMPEGfile\live stream?
...
I'll be the first to admit that my overall knowledge of low level programming is a bit sparse. I understand many of the core concepts but I do not use them on a regular basis.
That being said I was absolutely astounded at how much code was needed for dtoa.c.
For the past couple months I have been working on an ECMAScript implementation...
I have two C functions, which basically operate on a stack data structure. This one pushes a value of type OBJ which is actually just unsigned long to the top of the stack. The stack is also grown if necessary.
OBJ Quotation_push_(CzState *cz, CzQuotation *self, OBJ object)
{
if ((self->size + 1) > self->cap) {
self->items =...