Skip to content

Instantly share code, notes, and snippets.

@FlyingJester
Created July 9, 2014 10:15
Show Gist options
  • Select an option

  • Save FlyingJester/a6927f18f4120dcc200e to your computer and use it in GitHub Desktop.

Select an option

Save FlyingJester/a6927f18f4120dcc200e to your computer and use it in GitHub Desktop.
//Copy all chars not newlines.
char *makebuf; //...
char *newstring = new char [0xFF];
int e = 0;
for(int i = 0; i<strnlen(makebuf, 0xFF); i++){
if(makebuf[i]=='\n')
continue;
newstring[e] = makebuf[i];
e++;
}
newstring[e] = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment