btw. if it's not absolutely necessary to use an array (because a C function expects it as an argument or whatever), just use std::vector<bool>. It is even optimized to store the values in bits instead of bytes.
vector<bool> sucks imho. Its no STL-container and it doesnt hold bools. If you want a bitst use std::bitest if you want an array of bools use std::deque<bool>.
Well, I see, vector<T> is guaranteed to behave as a c-style array when it comes to addressing the data buffer (i.e. there is an internal array). But usually you wouldn't need to use it as a c-style array. And if you know that detail, I actually don't see why you would have to prefer bitset.
Anyway, how is it possible then to have a vector of bools, if vector<bool> is no STL container but automatically included in <vector>?
Sure, you can use other containers, but isn't that kinda dirty? Why didn't they think about a proper standard implementation then? If I want to have a vector<bool>, I want to have a vector<bool> and no dequeue<bool> :<
[Collecting] RDB Struct 05/10/2013 - Rappelz Private Server - 7 Replies hi every one ,
I have seen a lot of rdb struct
but in different topics so i started this topic to collect all of them
to help ppl that want to make a rdb tool or anything else
and for all of the ppl how have rdb struct in there pc please share it with us :D
Struct Allokieren ? 12/08/2012 - C/C++ - 11 Replies Hallo,
Ich arbeite mich gerade durch das Buch C++ A - Z und bin gerade bei den Structuren, so
jetzt habe ich mir als beispiel ein kleines (Telefon Buch) gemacht ganz simpel (Vorname, Nachname, Geschlecht, Nummer)
Code
#include "stdafx.h"
using namespace std;
[Java&Sql]Boolean... 10/03/2012 - Web Development - 4 Replies Hallo,
ich habe einen Boolean in Java, welchen ich gerne in eine Sqltabele eintragen würde. In der Datenbank habe ich ein Feld mit dem Datentyp Tinyint erstellt... Wie kann ich mein Boolean am einfachsten in eine Zahl umwandeln und umgekehrt... einfach eintragen geht nicht, da bekomme ich folgende meldung:
Incorrect integer value: 'false' for column 'SERVERREGION' at row 1
Java Boolean Frage 09/26/2012 - General Coding - 8 Replies Ich möchte in meinem Java Code eine Boolean Abfrage einbauen,
mein Problem dabei ist das bei der eingabe nur True oder False eingegeben werden kann,
wie schreibe ich in Java das wenn ich z.B "ja" eingabe der boolean auf true gestellt wird.
Dies ist relativ simpel da ich gerade erst mit Java begonnen habe jedoch finde ich es im Internet nicht.
Danke für eure Hilfe.
[c++] struct 08/25/2011 - C/C++ - 2 Replies Kann closed werden. sry