Thread: it takes to much memory!!

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    37

    Question it takes to much memory!!

    My problem is that I have a program that finds out all the symbols (the ones where you press like alt-33 for something) I am succesful at doing this and now I will show you my program code and my problem.


    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    int main()
        {
            int x;
            x = 0;
            fstream file_op("find out the symbols.html",ios::out);
            while (x < 1000)
            {
            ++x;
            file_op<<"&#"<<x<<";"<<" = "<<x<<"<br />"<<endl;
            }
            file_op.close();
            cout << "finished proccessing symbols";
            getchar();
            return 0;
        }
    the problem here is that it will put all in an html file because to make it work I have to use some html code to make it produce a symbol because if I tell it alt-133 it wont understand what I want. In html if you type in the source code "&#(whatever number);(here on is not neccesary) = (that number again)" the part after the semi colon just tells the veiwer what number combo you used.

    Now my problem is that it will count to like 9 milion or something really big. Now that takes like a Gig of space. So I am thinking that I should have it read it and see if the combo didnt make a symbol (if it is an incorrect combo it pops up with an empty square). I dont know how to read the actual browser to see what popped up. If i read the html file it reads the source code. So that will just read the numbers and then there wont be the symbol so it will let it by (if I made a filter wich is what I am trying to do). That is basicly it.

    thanks in advance,
    h3ckf1r3

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    huh?

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So, you want to produce something like this page:
    http://www1.tip.nl/~t876506/UnicodeDisplay.html

    I don't think you will ever need "9 million", but determining the "limit" you should stop at will be difficult.

    You should also be aware that different fonts or language packs may allow a smaller or larger set of "special characters".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    37
    yeah I thinkt hat may have been a bit to high of a number (also it was 99 milion not 9million) I changed it to 1 million and it went crazy. cuase when it got to about 10000 it started jumping around. I did read a link that is basicly what my program does but not so organized. I decided to just zip the html file (or in other words compress it) wich mad it take up only lik 25 megabytes instead of like 250! so it helped. I think the main issue is solved and I think I will be able to make it so that the person can type a number and get the symbol for that number. I can think of how in basic just need to find out the translated commands. Although it would be pretty useless becuase the person would be just pressing random numbers until they get the symbol. What do you guys think? and for the person that said "Huh?" Please clarify on what you dont understand

  5. #5
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Quote Originally Posted by h3ckf1r3 View Post
    ,,, and for the person that said "Huh?" Please clarify on what you dont understand
    From all the like problems you like mentioned, I couldn't like figure out like what the problem was.

    No biggy.

    Todd

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    37
    ok for starters thoughs numbers were incorrect because it was originaly 25 megabytes and after compression it was around 4 megabytes sorry for any mis understanding this may have caused. Another thing is that I may have found the key to eliminating the extra nonworking codes. when I looked up about the file output I used. It was for text files there is probably another way for opening and outputing or inputing a file for an html filewich I will be trying to find it and will post anything that I find.

    thanks for all your help,
    h3ckf1r3

  7. #7
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    So basically you want a Unicode table.

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    37
    I think that is what I am talking about but I am now sure and for wich thing? I am wanting a couple things. If you are refering to the symbols then go to the link that was posted by matsp. Those are what I am talking about. That might be a unicode table.

    thanks for all help,
    h3ckf1r3

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with shared memory shmdt() shmctl()
    By Jcarroll in forum C Programming
    Replies: 1
    Last Post: 03-17-2009, 10:48 PM
  2. Suggestions on this C style code
    By Joelito in forum C Programming
    Replies: 11
    Last Post: 06-07-2007, 03:22 AM
  3. Relate memory allocation in struct->variable
    By Niara in forum C Programming
    Replies: 4
    Last Post: 03-23-2007, 03:06 PM
  4. Shared Memory - shmget questions
    By hendler in forum C Programming
    Replies: 1
    Last Post: 11-29-2005, 02:15 AM
  5. Memory allocation and deallocation
    By Micko in forum C++ Programming
    Replies: 3
    Last Post: 08-19-2005, 06:45 PM