User Profile

Collapse

Profile Sidebar

Collapse
Visame
Visame
Last Activity: Aug 31 '08, 11:32 AM
Joined: Dec 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Visame
    started a topic SGI/STL __STL_CLASS_REQUIRES(_Tp, _Assignable);
    in C

    SGI/STL __STL_CLASS_REQUIRES(_Tp, _Assignable);

    Code:
    __STL_CLASS_REQUIRES(_Tp, _Assignable);
    This sentence appears many times int the SGI/STL source code.
    However, this macro seems to do nothing int the cource code.
    The Following is the Macro Definition in concept_checks. h:

    Code:
    #ifndef __STL_USE_CONCEPT_CHECKS
    
    // Some compilers lack the features that are necessary for concept checks.
    // On those compilers we define the concept check macros to do
    ...
    See more | Go to post

  • Visame
    replied to member function error..
    in C
    Obviously, your class lack the CONSTRUCTOR.
    See more | Go to post

    Leave a comment:


  • Code:
    while (!feof(fp))
    {
    fscanf(fp, "%d %s %c %c" , &age, &name, &sex, &sn);
    printf("the data in name is %s\n",name)
    }
    I believe the problem lies in function FEOF.
    You can try this:
    Code:
    if (fscanf(fp, "%d %s %c %c" , &age, &name, &sex, &sn)==4)
    printf("the data in name is %s\n",name);
    or
    ...
    See more | Go to post

    Leave a comment:


  • Visame
    started a topic Static data members initialization
    in C

    Static data members initialization

    The following example is from C++ Standard(ISO148 82)
    9.4.2 Static data members
    class process {
    static process* run_chain;
    static process* running;
    };
    process* process::runnin g = get_main();//what does get_main() mean here?
    process* process::run_ch ain = running;

    C++ Standard also says in:
    5.19 Constant expressions
    In several places, C + + requires expressions that evaluate...
    See more | Go to post

  • Visame
    started a topic A paragraph from Bjarne stroustrup's Book
    in C

    A paragraph from Bjarne stroustrup's Book

    How to understand the following paragraph from Bjarne stroustrup's The C++ Programming Language?
    9.4.1:
    In principle, a variable defined outside any function (that is, global, namespace, and class static variables) is initialized before main() is invoked. Such nonlocal variables in a translation unit are
    initialized in their declaration order (ยง10.4.9). If such a variable has no explicit initializer, it is by default initialized...
    See more | Go to post

  • Visame
    started a topic Why there is NO Copy or Assign for IO Objects?
    in C

    Why there is NO Copy or Assign for IO Objects?

    Code:
    ofstream out1, out2;
        out1 = out2;   // error: cannot assign stream objects
        // print function: parameter is copied
        ofstream print(ofstream);
        out2 = print(out2);  // error: cannot copy stream objects
    Why there is NO Copy or Assign for IO Objects? Can anyone tell me the reason? Thanks!
    See more | Go to post

  • Confusion on Virtual function,copy constructor,and type conversion

    Code:
    #include <iostream>
    using namespace std;
    
    class   A
    {
    public:
        A() {cout << "constructor A" << endl;}
        A(A& a) {cout<<"copy A"<<endl;}
        virtual   void   Test(){cout <<"A   test" <<endl;}
    };
    
    class   B:public   A
    {
    public:
        B() {cout << "constructor B"
    ...
    See more | Go to post
No activity results to display
Show More
Working...