去掉base64的"\n"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void del(char *s)
{
        int i = 0,j = 0;
        for(i=0;s[i]!='\0';)
        {
                if ( s[i]=='\n' )
                {
                        for(j=i;s[j]!='\0';j++)
                        {
                                s[j]=s[j+1];
                        }
                }
                else
                {
                        i++;
                }
        }
}




int main(void)
{


        char s[80]={"a\ne\nb\n"};

        printf("----, %d\n",  strlen(s));
        del(s);

        printf("====, %d\n%s\n",  strlen(s), g);


        return 0;
}

在線工具 http://tool.chinaz.com/tools/imgtobase/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章