Pon el fragmento de código, entre las etiquetas GeSHi, para que lo vea.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúnum = num | 0b00000001;
#include <stdio.h>
typedef struct TreintaydosBits {
unsigned bit1 : 1;
unsigned bit2 : 1;
unsigned bit3 : 1;
unsigned bit4 : 1;
unsigned bit5 : 1;
unsigned bit6 : 1;
unsigned bit7 : 1;
unsigned bit8 : 1;
unsigned bit9 : 1;
unsigned bit10: 1;
unsigned bit11: 1;
unsigned bit12: 1;
unsigned bit13: 1;
unsigned bit14: 1;
unsigned bit15: 1;
unsigned bit16: 1;
} TreintaydosBits;
typedef union CuatroBytes {
short n;
TreintaydosBits b;
} CuatroBytes;
int main(){
CuatroBytes cb;
cb.n=0;
cb.b.bit3 = 1;
printf("%d",cb.n);
}
ofstream out = /*...*/;
vector<string> v = /*...*/;
size_t tam = v.size();
out.write((char*)&tam, sizeof(tam));
for(string& s:v){
tam = s.size();
out.write((char*)&tam, sizeof(tam));
out.write(s.c_str(), tam);
}
<NUM_STRINGS><string1><string2><...>
<NUM_CHARS><chars_array>
Dimension arr(10)
Para t<-1 Hasta 10 Hacer
arr(t)<-0
FinPara
Para t<-1 Hasta 10 Hacer
arr( valores(t) ) <- arr( valores(t) ) + 1
FinPara