Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
char *eraseAllBlanks(char *str){
char *runner=str;
char *temp=(char *)malloc(strlen(str));
while (*runner!='\0'){
while(*runner==' ')
runner++;
temp=runner;
temp++;
runner++;
}
runner=temp;
free(temp);
return runner;
}
void main (void){
char *in="Ha llo W e lt ";
printf("%s", eraseAllBlanks(in));
}
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
char *eraseAllBlanks(char *str){
char *runner=str,*start;
char *temp=(char *)malloc(sizeof(str));
if(*runner!='\0'){
while(*runner==' ')
runner++;
temp=runner++;
start=temp++;
}
while (*runner!='\0'){
while(*runner==' ')
runner++;
temp=runner++;
temp++;
}
free(temp);
return start;
}
void main (void){
char *in="Ha llo W e lt ";
printf("%s", eraseAllBlanks(in));
}
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
char *eraseAllBlanks(const char *str)
{
char *buf = malloc(strlen(str));
if( buf == NULL )
return NULL;
while(*str)
{
if( *str != ' ' )
*buf++ = *str;
str++;
}
return buf;
}
int main (int argc, char **argv)
{
char *in="Ha llo W e lt ";
char *out = eraseAllBlanks(in);
printf("%s", out);
free(out);
}
while(*str)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *eraseAllBlanks(const char *str)
{
char *dst, *src;
char *buf = malloc(strlen(str));
if( buf == NULL )
return NULL;
memset(buf, 0, strlen(str));
src = str;
dst = buf;
while(*src)
{
if( *src != ' ' )
*dst++ = *src;
src++;
}
return buf;
}
int main (int argc, char **argv)
{
char *in="Ha llo W e lt ";
char *out = eraseAllBlanks(in);
printf("%s", out);
free(out);
getchar();
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char input[] = "Hal lo We lt !";
char chr[] = " ";
printf("%s\n",input);
char* token;
token = (char*)strtok(input,chr);
while(token != NULL){
printf("%s",token);
token = (char*)strtok(NULL,chr);
}
printf("\n");
system("PAUSE");
return 0;
}
Hal lo We lt !
HalloWelt!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* eraseAllBlanks (const char *str)
{
char *ret = (char*) malloc (strlen (str) + 1); // strlen() gibt die Länge ohne \0 zurück daher +1
int i;
int j = 0;
if (ret == NULL)
{
return NULL;
}
for (i = 0; i < strlen (str); i++)
{
if (str[i] != ' ')
{
ret[j] = str[i];
j++;
}
}
ret[j] = '\0';
return ret;
}
int main()
{
const char *in = " W o rd ";
char *str = eraseAllBlanks (in);
printf ("%s", str);
free (str);
}