Datentypen



  • stimmt ja auch



  • Äh, mal noch eine Frage:
    gibt es unsigned float und unsigned double???



  • D schrieb:

    In meinem C++-Buch steht, dass signed char und nur char das gleiche sind!!!

    In Büchern steht eben manchmal Unsinn.

    D schrieb:

    gibt es unsigned float und unsigned double???

    Nein.



  • Und was ist dann der Unterschied zwischen char und unsigned char???



  • D schrieb:

    Und was ist dann der Unterschied zwischen char und unsigned char???

    Das hat CStoll doch schon geschrieben:

    CStoll schrieb:

    'char', 'signed char' und 'unsigned char' sind drei unabhängige Datentypen (allerdings stimmt der Wertebereich von 'char' mit einem seiner Brüder überein - welcher, ist Sache des Compilers).



  • c+++ schrieb:

    stimmt ja auch

    Nein, stimmt nicht - char ist eigenständig (sag mal, rede ich gegen eine Wand?):

    Ansi Standard schrieb:

    3.9.1 Fundamental types [basic.fundamental]

    1 Objects declared as characters char) shall be large enough to store
    any member of the implementation's basic character set. If a charac-
    ter from this set is stored in a character object, the integral value
    of that character object is equal to the value of the single character
    literal form of that character. It is implementation-defined whether
    a char object can hold negative values. Characters can be explicitly
    declared unsigned or signed. Plain char, signed char, and
    unsigned char are three distinct types.
    A char, a signed char, and an
    unsigned char occupy the same amount of storage and have the same

    alignment requirements (_basic.types_); that is, they have the same
    object representation. For character types, all bits of the object
    representation participate in the value representation. For unsigned
    character types, all possible bit patterns of the value representation
    represent numbers. These requirements do not hold for other types. In
    any particular implementation, a plain char object can take on either
    the same values as a signed char or an unsigned char; which one is
    implementation-defined.



  • Ok, dann kann mich jetzt an die Funktionen ran machen. Vielen Dank noch einmal an Alle!!!



  • Sry, aber das ist jetzt die letzte Frage. Also auf einer Internetseite habe
    ich gelesen es gäbe für Zeichen nur die Basisdatentypen char, signed char,
    unsigned char und wchar_t. so etwas wie signed und unsigned wchar_t gäbe es.
    Auf einer anderen Seite habe ich dann folgendes für Zeichen gelesen:
    (unsigned) wchar_t

    Gibt es jetzt unsigned wchar_t oder nicht???



  • Nein, gibt's nicht.



  • google nach "signed unsigned char" liefert als ersten folgenden, recht informativen link: http://www.trilithium.com/johan/2005/01/char-types/



  • Die Seite habe ich auch als erstes gefunden.


Anmelden zum Antworten