I'm a C beginner, today I encountered a problem that puzzled me for hours and I subtracted the clauses where the problem occurs.
I compiled it with Archlinux(gcc).
vmware fedora 13 x86 server
$cat memory.c
#include <stdio.h>
#include <stdlib.h>
main()
{
char *memory;
int size=1024;
int m=0;
int i=0;
sleep(60);
while(1)
{
for(i=0;i<1024;i++){
memory = (char *)malloc(size);
if(memory == NULL) exit(-1);
sprintf(memory, "i love memoney!\n");
}
Hello everyone and thank you for looking at my little problem. I haven't programmed in C for a while, so I am trying to remember certain aspects of syntax. I have a program that will fork and exec other programs.
I'm working on a high performance I/O program and I'm trying to find the best way to determine the physical (and not the logical) byte size of a device's disk blocks with C++.
I have following (reduced) simple application which was built with line:
gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_GNU_SOURCE -D_XOPEN_SOURCE -std=c99 -ggdb -O0 main-test.c -L/usr/lib -lm -lglib-2.0 -o main-test
The application itself:
#include <stdio.h>
#include <ctype.h>
#include <alloca.h>
#include <glib.h>
#include <glib/gpr
Hi friends,
I have been writing one c code to validate any url passed by a user.
Here is the code I have so far coded.
I am using one dictionary file to check values like http, https, www, ftp, etc for the URL that a user will pass for validation.
My code so far holds good for every thing except for if blank spaces or a new line character or a tab is mentioned in the URL string passed by user.
Can you help me in finding out why this program is giving segmentation fault?
Hi everyone, I'm making a multimedia library to speedup vector and matrix computation.
But I'm getting a strange error, in this code
Quote:
void memcpy_unrolled_sse2(void *dst, void *src, int size)
{
int i = 0,
length = (size/16)*16,
length2 = (size/32)*32,
length4 = (size/64)*64,
length8 = (size/128)*128;
char *a = (char *)src;
char *b = (char *)dst;
Hello C specialists,
I'm trying to write a program to read out a binary configuration file produced by a router.
But the output of Name and Value is cryptic.