Woah, that's nice and clean.
Thanks SlyMaelstrom.
And yeah, I will go with what Dave posted, but I just wanted to finish my own fuction for learing purposes :)
Thanks for now.
Type: Posts; User: phatsam
Woah, that's nice and clean.
Thanks SlyMaelstrom.
And yeah, I will go with what Dave posted, but I just wanted to finish my own fuction for learing purposes :)
Thanks for now.
Thank you all for your quick reply and pointers!
I've updated the code and it works very well.. almost.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
This code splits 'source' into tokens of nick, ident and host.
It works and compiles without errors (using gcc -W -Wall).
However, if i change the *source to...
Yeah I've tried that, but that gives me
$ gcc -W -Wall ptr_explode.c -o ptr_explode
ptr_explode.c: In function `ptr_explode':
ptr_explode.c:25: warning: return makes integer from pointer...
Im trying to make a function that will split the words (like perl's split and php's explode), but im getting a couple of errors which I don't understand.
Errors:
$ gcc -W -Wall ptr_explode.c -o...
Alright, thanks guys.
Hi again.
I'm trying to make something that will behave somewhat like php's explode(), but im failing to do so.
Here's what I got so far:
#include <stdio.h>
#include <string.h>
Ah, ofcourse!
Thanks man
Hrm, for some reason that doesn't work here;
#include <stdio.h>
int main()
{
char string[] = "randomtext";
char string_bit;