Although I cared about that,still does not halt. Looks like infinite loop..
Type: Posts; User: zhankal
Although I cared about that,still does not halt. Looks like infinite loop..
I'm trying to get a string with unknown length and i used this weird code:
int main()
{ char *ptr
int l;
ptr = (char *) malloc(sizeof(char *) * 10);
If i were you i would try double,if it does not enough to satisfied then maybe long double..
If you think so, you should develop your mathematical & analytical skills.
+1
K&R is one of the best books which develop you, of course if you practice what you read.
For just to get rid of this warnings, in what else way can i read the string? (the problem is i need to care about whitespaces and i don't know the size of input)
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
int main()
{
int bytes_read;
int nbytes = 100;
Well i tried to include it before including the stdio.h and I get this error , interesting
error: pointer targets in passing argument 2 of ‘getdelim’ differ in signedness
Yeah, I'm trying to find that header file. I actually found some stuff like including #define _GNU_SOURCE ...but that didn't work.
For a string problem, I tried to use getdelim function and I get this warning :
warning: implicit declaration of function ‘getdelim’
I guess it's a library problem although I have tried to...
I suggest you to check out this:
As far as I know ANSI C does not allow such declerations.