User Profile

Collapse

Profile Sidebar

Collapse
eagerlearner
eagerlearner
Last Activity: Sep 4 '07, 01:08 AM
Joined: Jul 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks, you are good poet, but I don't really understand. lol found more information in Wikipedia, in case if anyone like to know what is those three weird characters that I just knew as well....
    See more | Go to post

    Leave a comment:


  • lol, actually the real problem is

    1) Open the file with notepad .. save as .. choose ANSI encoding

    run the code.


    2) Open the file with notepad .. save as .. choose UTF-8 encoding

    run the code.

    it only works in ANSII, but I never realize that I save the file as UTF-8
    See more | Go to post

    Leave a comment:


  • Thanks for that hint,
    Now I delete both the .html and .txt and I go to my project file and recreate both file with following steps, then it works fine with my original code. FYI, I am using Windows Vista.
    - Right click "new" > "text document"
    - Name it as "txt.txt"
    - open and type "abc"
    - save the file
    - using the same text file
    - change to "def"...
    See more | Go to post

    Leave a comment:


  • ifstream file gives weird character for .html extension

    When I open .html file i got a few weird characters printed out which preceding the content inside the .html file. But when I have the same file content with .txt extension, it has not problem. Anyone knows why ? Thanks.

    Code:
    #include <iostream>
    #include <string>
    #include <fstream>
    using namespace std;
    
    int main()
    {
    	string buff, temp;
    	ifstream file;
    ...
    See more | Go to post

  • eagerlearner
    replied to error LNK2019: unresolved external symbol
    in C
    Thanks, finally I get it to work, when I create header file and copy it from htmlcxx source file manually to include into my project. I don't use the configure or makefile at all, It works so graceful. Thanks.
    See more | Go to post

    Leave a comment:


  • eagerlearner
    replied to error LNK2019: unresolved external symbol
    in C
    Thanks, I am using windows, so now I am using cywin for my very first time, change my directory to the sources file with "cd [DIRECTORY]" , after that I type "configure" , gives command not found, can give me a little hint on running the configure in cywin, if you don't mind ? Really2 thank you.
    See more | Go to post

    Leave a comment:


  • eagerlearner
    replied to error LNK2019: unresolved external symbol
    in C
    Thanks for the reply, really appreciate that. The project can be downloaded here http://sf.net/projects/htmlcxx
    I guess, I have to install first, which I have not done yet, I saw those MakeFile which I encounter very often but have not yet know how to use it. I need to run the config file but what kind of shell i need to run ? can give a very brief instruction ? Thank you.
    See more | Go to post

    Leave a comment:


  • eagerlearner
    started a topic error LNK2019: unresolved external symbol
    in C

    error LNK2019: unresolved external symbol

    I tried to figure out myself but still can't figure out,
    Basically there is two file, main.cpp, ParserDom.h. The ParserDom.h was located in the "html" folder which located same place as main.cpp
    But when I compiled, I get error LNK2019: unresolved external symbol
    which all of them referring to member function of ParserDom class. Can anyone figure out ?
    I always get this kind of problem, can anyone give me...
    See more | Go to post

  • eagerlearner
    replied to sort hash_set in alphabetical order
    in C
    Thanks for the reply, it help clear a bit of my curiosity. I think I got to use the std::map instead of stdext::hash_ma p if I want to have the alphabetical order.
    See more | Go to post

    Leave a comment:


  • eagerlearner
    started a topic sort hash_set in alphabetical order
    in C

    sort hash_set in alphabetical order

    I have the following code, which does not sort the list in alphabetical order, how can I sort everything in alphabetical order ? Before that, I want to ask, when an insertion occur, does it compare the string that I am inserting with every string inside the set list ? or just with string that is beside the location that is going to be inserted ? Thank you.

    [code]
    Code:
    #include <iostream>
    #include <hash_set>
    ...
    See more | Go to post

  • eagerlearner
    replied to Object destroyed still can be called, why ?
    in C
    Yeah, when I put another member data and try to access it in write, my program hang. I can understand already for this, but about the virutal function that JosAH posted, why declaring virtual function make it hang as well ? How does it work ? Thank you.
    See more | Go to post

    Leave a comment:


  • eagerlearner
    started a topic Object destroyed still can be called, why ?
    in C

    Object destroyed still can be called, why ?

    I am learning the C++ oop, why when I create an object and delete it but it still can be called even though it's destroyed. Check this simple code here. Thank you.

    Code:
    #include <iostream>
    using namespace std;
    
    class h
    {
    public:
    	h(){ cout << "h called\n";};
    	void write() { cout << "write\n";}
    	~h(){cout << "h destroyed\n"; };
    ...
    See more | Go to post

  • eagerlearner
    replied to hash_map give unexpected value.
    in C
    Thanks for the reply, I just found out that for hash_map it has to derive the class from hash_compare and at least both the hash function and comparison must be specified. Thank you.

    Code:
    class hasher : public stdext::hash_compare<const char *>
    {
    public:
    
    size_t operator() (const char* s) const
    {
    	size_t h = 0;
    	size_t max, i;
    	for(i = 0, max = strlen(s); i < max;
    ...
    See more | Go to post

    Leave a comment:


  • eagerlearner
    started a topic hash_map give unexpected value.
    in C

    hash_map give unexpected value.

    Can anyone check this out, why does this give me the default value of 0 instead of 1 ? Thank you.
    Code:
    #include <iostream>
    #include <hash_map>
    #include <string>
    using namespace std;
    
    int main()
    {
    	stdext::hash_map<const char *, int> hm;
    	hm["abc"] = 1;
    	hm["def"] = 2;
    
    	string s = "abc";
    
    	cout
    ...
    See more | Go to post

  • eagerlearner
    replied to CreateThread() arguement error
    in C
    Again I got another problem, why does this give me the default value of 0 instead of 1 ? Thank you.

    Code:
    #include <iostream>
    #include <hash_map>
    #include <string>
    using namespace std;
    
    int main()
    {
    	stdext::hash_map<const char *, int> hm;
    	hm["a"] = 1;
    	hm["b"] = 2;
    
    	string s = "a";
    ...
    See more | Go to post

    Leave a comment:


  • eagerlearner
    replied to CreateThread() arguement error
    in C
    Thanks, before you tell me, I never know there is a keyword mutable, cool. I think I would prefer using the mutable and keep my member function const. I wish I have started learning programming since I was a baby. :)
    See more | Go to post

    Leave a comment:


  • eagerlearner
    replied to CreateThread() arguement error
    in C
    Thanks, in my actual implementation I decalare it as static member function, now I see my mistake is actually the function prototype that I did not follow. I got another problem here using hash map. I thought no need to post in new thread.


    Code:
    #include <hash_map> 
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    static enum H_FIELD {H_UNDEFINED, H_FIRST,
    ...
    See more | Go to post

    Leave a comment:


  • It's because inside your function x(int, int) ask for another user input that will be stored in the int d variable, I already commented that, now it should work as below.

    Code:
    #include <iostream> //needed for input output
    
    using namespace std;
    
    //---------------------------------------------------------------------------
    
    
    int x (int, int); /* function declaration
    ...
    See more | Go to post

    Leave a comment:


  • eagerlearner
    started a topic CreateThread() arguement error
    in C

    CreateThread() arguement error

    Hallo, when I use class and I put one of the member function as the CreateThread argument, I keep getting the compile error in Visual Studio 2005.

    Code:
    #include <windows.h>
    
    class X {
    public:
    	void f();
    	void s(){};
    };
    
    void X::f()
    {
    	//error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (__thiscall X::* )(void)' to 'LPTHREAD_START_ROUTINE'
    ...
    See more | Go to post

  • eagerlearner
    replied to character pointer to string
    in C
    Sorry, I have not shown the important part, the actual code is like these. if the url is www.yahoo.com/mail/ the function should return /mail/
    But what I get printed out is weird "h !!" characters. Thanks so much.

    Code:
    const char * Url::getFileName() const
    {
    	int nStart;
    	char * scheme = "://";
    	if((nStart = m_url.find(scheme,0)) == string::npos ) // protocol http:// or https://
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...