I am getting an error that makes no sense.
I set up Allegro 5, and could compile the following code with success:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <allegro5/allegro.h>
void error(char *msg)
{
fprintf(stderr,"%s : %s\n", msg, strerror(errno));
exit(1);
}
int main(int argc, char **argv)
{
ALLEGRO_DISPLAY *display = NULL;
if(!al_init())
error("Could
Original source code :#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {
int max = -1;
int mb = 0;
char* buffer;
if(argc > 1)
max = atoi(argv[1]);
while((buffer=malloc(1024*1024)) != NULL && mb != max) {
memset(buffer, 0, 1024*1024);
mb++;
printf("Allocated %d MB\n&quo
Hi everyone,I got error when I run this program. I am using ubuntu 11.10.
This is my program.
I have been working with GTK and feel bad about the way I am passing arguments to callback functions.
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.
this is strange .. i did use forward declaration in c++ but in c it is giving me an error ... for example:
Code:
#include <stdio.h>
#include <string.h>
typedef struct Student S;
typedef struct Student{
char name[100];
}S;
int main()
{
char c[100];
S s;
Can you help me in finding out why this program is giving segmentation fault?
I've a simple code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x=99;
char str[100];
itoa(99, str, 10);
return 0;
}
Trying to compile in using terminal in gcc with :
gcc test.c
But I get the error:
/tmp/ccJN77g6.o: In function `main':
test.c:(.text+0x35): undefined reference to `itoa'
collect2: ld returned 1 exit status
Why so?