Thread: typing effect on text

  1. #31
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    size_type is meant to hold an unsigned integral. That's about it. There's no other assumption made.

    This number must be big enough to hold the maximum number of characters a string can hold.

    Since a string maximum lenght is machine/implementation dependant, the size_type companion type was created (as a typedef) to support machine-independant behavior. It can be an int, a long, the number of extra-marital kids the library implementator had at that time.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #32
    Registered User
    Join Date
    Sep 2006
    Posts
    7
    i still got errors on my compiler. btw, i'm using turbo c++ v.3. maybe it's just my compiler.

  3. #33
    Registered User
    Join Date
    Oct 2004
    Posts
    151
    Quote Originally Posted by painkiller05
    i still got errors on my compiler. btw, i'm using turbo c++ v.3. maybe it's just my compiler.
    Well Turbo C++ 3.0 is about fourteen years old, so yeah, maybe it is.
    System: Debian Sid and FreeBSD 7.0. Both with GCC 4.3.

    Useful resources:
    comp.lang.c FAQ | C++ FQA Lite

  4. #34
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    Just get the good-old dev.

    Thanks for that info, Mario. Always informative! ... "the number of extra-marital kids the library implementator had at that time." .... right
    Last edited by twomers; 09-02-2006 at 09:41 AM.

  5. #35
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    That's the way I would do it!
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #36
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Dev-C++ -- it's not fourteen years old
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  7. #37
    ... arjunajay's Avatar
    Join Date
    May 2005
    Posts
    203
    in turbo C I think you have to use STRNG.h because string is already taken for strlen(), strcpy etc. I think.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Text adventure engine idea. thoughts?
    By suzakugaiden in forum Game Programming
    Replies: 16
    Last Post: 01-15-2006, 05:13 AM
  2. reading from text file
    By jamez in forum C Programming
    Replies: 3
    Last Post: 11-30-2005, 07:13 PM
  3. Removing text between /* */ in a file
    By 0rion in forum C Programming
    Replies: 2
    Last Post: 04-05-2004, 08:54 AM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM