User Profile

Collapse

Profile Sidebar

Collapse
RafaelSousa
RafaelSousa
Last Activity: Dec 2 '13, 01:40 PM
Joined: Dec 2 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Code:
    char **explode(char *delimiter, char *str, int *numberelements){
    	char *str2;
        char *straux=NULL;
        char *strinicio=NULL;
        char **result=NULL;
        int tokens=1;
    
    	str2=(char *)malloc(strlen(str)+1);
    	strcpy(str2,str);
        *numberelements=0;
        straux=strinicio=str2;
        while(straux){
            straux=strstr(strinicio,delimiter);
            if (straux){
    ...
    See more | Go to post

    Leave a comment:


  • Explode in C. Problem with pointer to pointer and realloc

    Hi guys. I have this code:

    char **explode(char *delimiter, char *str, int *numberelements ){
    char *str2;
    char *straux=NULL;
    char *strinicio=NULL ;
    char **result=NULL;
    int tokens=1;

    str2=(char *)malloc(strlen (str)+1);
    strcpy(str2,str );
    *numberelements =0;
    straux=strinici o=str2;
    while(straux){
    straux=strstr(s trinicio,delimi ter);...
    See more | Go to post
No activity results to display
Show More
Working...