I'm getting a "Syntax error at end of input" (last line). but i can't find what's wrong.
int main() {
int ett;
FILE *filen;
int val;
char filnamn[40];
enum filtyp {db,txt,bin};
typedef...
Type: Posts; User: implor
I'm getting a "Syntax error at end of input" (last line). but i can't find what's wrong.
int main() {
int ett;
FILE *filen;
int val;
char filnamn[40];
enum filtyp {db,txt,bin};
typedef...
i'm trying to sort a array using qsort() but i just get junk printed. It probably has something to do with my pointers but i can't find what's wrong.
#include <stdio.h>
#include <stdlib.h>...
It's printing correct now. Thanks! but when it reach return 0 in main() the window close, should it do that? I use DeV-C++
Now p1 is a pointer. now i get back to a old problem (p1 was a pointer before) now i get Segmentation Fault at
#include <stdio.h>
#include <stdlib.h>
#include "lab41.h"
person...
allright. I'm trying to allocate memory with malloc but i'm getting a error.
&p1 = (person*) malloc(sizeof(person));
error: invalid lvalue in assignment
allright, I change personer[10] to a global varible and that it only print one post. but still the same.
output.
client128-24:CORSAIR $ ./a.out
enter filename:: p.txt
Johan olsson
32
64
when I print out my array in one place it works fine, in another function the same code don't work.
my code
#include <stdio.h>
#include <stdlib.h>
#include "lab41.h"
int readfil(FILE...