Search:

Type: Posts; User: CoiledAlizarine

Search: Search took 0.01 seconds.

  1. Some garbage code (without error checking, for...

    Some garbage code (without error checking, for simplicity):


    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <string>
    #include <vector>
    #include <set>
  2. You can change to the UTF-8 codepage using...

    You can change to the UTF-8 codepage using setlocale() and use iswalpha()



    #include <stdio.h>

    #include <wchar.h>
    #include <wctype.h>
    #include <locale.h>
  3. #include #include ...

    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>

    void countOccurrences(char* str)
    {
    // 1) Count occurrences.
    int occurrences[256] = {0};
    for(; *str; str++)
    ...
  4. Replies
    3
    Views
    4,742

    Thanks, Malcolm Mclean. It is a pity that this is...

    Thanks, Malcolm Mclean. It is a pity that this is merely an unimplemented optimization. Well, at least in these cases #pragma pack(1) can save me some bytes with no performance cost.
  5. Replies
    3
    Views
    4,742

    Anonymous struct padding

    #include <stdio.h>

    struct A {
    int i;
    char a, b, c;
    };

    struct B {
    struct {
    int i;
  6. Replies
    5
    Views
    5,475

    You may be confusing the value and address of a...

    You may be confusing the value and address of a and p.



    Value Address
    a 10 1116119516

    p 1116119516 1116119520
Results 1 to 6 of 6