Ok, takže je to celkem opruz dělat s řetězcema v C no

CZechBoY píše:Tisícovej buffer fakt nechci používat, však to žere 1kB paměti ať tam nacpu 2 znaky nebo 1000 ne?
Kód: Vybrat vše
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int i,*u;
char p[1000],*s;
u=malloc(sizeof(int));
s=malloc(1000*sizeof(char));
printf("\nstreamy:\n");
printf("stdin\t%u\n",stdin);
printf("stdout\t%u\n",stdout);
printf("stderr\t%u\n",stderr);
printf("\nstatické:\n");
printf("i\t%u\n",&i);
printf("p[]\t%u\n",p);
printf("\ndynamické:\n");
printf("u\t%u\n",u);
printf("s[]\t%u\n",s);
return 0;
}
Kód: Vybrat vše
streamy:
stdin 3078068832
stdout 3078068672
stderr 3078068512
statické:
i 3219758004
p[] 3219757004
dynamické:
u 141828104
s[] 141828120
CZechBoY píše:A co když budu chtít uložit víc jak je ten buffer
Odmítám tyhle blbosti.
Kód: Vybrat vše
int pole[10],a,b,c;
pole[10]=12345;
Zpět na “Programování a tvorba webu”
Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 3 hosti