Search:

Type: Posts; User: zouyu1983

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Can struct be declared in the main function?

    Can struct be declared in the main function?
  2. Replies
    10
    Views
    1,679

    when i confront this situation, i often allocate...

    when i confront this situation, i often allocate a large enough space in the stack or the heap to store the data.
    or you can use the dynamic array for this. input the data into the dynamic array...
  3. Replies
    6
    Views
    3,071

    the best way to learn language is to program. i...

    the best way to learn language is to program.
    i think it will be very helpful to do some acm excrcises.Although it focus on the algorithms,you will improve your skill of the language when you...
  4. Replies
    2
    Views
    1,023

    the first case : the compiler will call the...

    the first case : the compiler will call the copy-constructor to construct a temp string which the value is the same as the test, and when the function ends, the compiler will call the destructor
    to...
  5. Replies
    2
    Views
    1,828

    >> I've written some code for my class without...

    >> I've written some code for my class without them and it worked really fine

    The compiler will create a default constructor for you if you don't creat any,but the constructor that the compiler...
  6. Replies
    2
    Views
    928

    please do your best to implement the code first,...

    please do your best to implement the code first, then if your code doesn't work correctly, then post it and we will glad to help you
  7. Replies
    8
    Views
    2,990

    i like searching algorithms

    i like searching algorithms
  8. Replies
    5
    Views
    1,214

    Oh, sorry, i didn't see it clearly. the...

    Oh, sorry, i didn't see it clearly.

    the someclass_2 is a member of the smoeclass_1 because you declare it in the someclass_1, so when you define the someclass_2,you must write it like the style...
  9. Sorry, but I don't quite understand what the...

    Sorry, but I don't quite understand what the "Boost.Thread" means?
  10. Replies
    5
    Views
    1,214

    if you want to make the class someclass_2 the...

    if you want to make the class someclass_2 the friend class of the someclass_1, you must declare it first, otherwise the compiler will not know what the someclass_2 is.

    but in someclass_2, you can...
  11. A question about _beginthreadex(), a Win32 API Function

    I'm confusing how to pass a argument into the thread function.After studying some documents about the thread, i wrote a program which could run correctly about the argument passing.But i feel that...
  12. Replies
    2
    Views
    1,347

    A question about string

    char *p = "i come from china";

    does it allocate in the stack,or static area of the memory?

    does the standard define the behavior that modifys the value of the string like this?

    thanks
  13. Replies
    8
    Views
    1,125

    all the parameter is passed by value,look at the...

    all the parameter is passed by value,look at the program below


    #include <iostream>
    #include <string>

    using namespace std;

    void create(string* x)
    {
  14. Replies
    16
    Views
    2,007

    i'm sorry, the output of the program is undefined...

    i'm sorry, the output of the program is undefined
    now give the answer i test

    in windows xp sp2 vc.net 2003, the output is:
    98012345980123456789
    980123456789
    6789

    in windows xp sp2 g++, the...
  15. Replies
    16
    Views
    2,007

    you mean that in ANSI C++ , there is no guarantee...

    you mean that in ANSI C++ , there is no guarantee aboult it?
    maybe i make mistakes.
    i will review the standard.
    anyway, thanks^_^
  16. Replies
    16
    Views
    2,007

    you can try it ^_^, and i am sure the output is...

    you can try it ^_^, and i am sure the output is unique without induring any problem
  17. Replies
    16
    Views
    2,007

    the standard make guarantee of the global...

    the standard make guarantee of the global variables being stored contiguously in the static area of the memory
  18. Replies
    16
    Views
    2,007

    the output is unique and the program will not...

    the output is unique
    and the program will not induce a runtime error
  19. Replies
    16
    Views
    2,007

    just give the ouput of the program the program...

    just give the ouput of the program
    the program runs correctly
  20. Replies
    16
    Views
    2,007

    a funny test^_^

    hi,guys, i saw a interesting program today,the source code is:


    #include <iostream>
    using namespace std;

    char a[] = "abcdefg";
    char b[] = "1234567";
    char c[] = "980123456789";
  21. Replies
    14
    Views
    3,861

    do you know chinese?

    do you know chinese?
  22. Replies
    14
    Views
    3,861

    d:\My works\VC++.NET 2003...

    d:\My works\VC++.NET 2003 WORKS\Workplace\test\test.c(10) : warning C4013: “printf”未定义;假设外部返回 int
    d:\My works\VC++.NET 2003 WORKS\Workplace\test\test.c(29) : warning C4013: “scanf”未定义;假设外部返回 int...
  23. Replies
    14
    Views
    3,861

    i'm not good at english, you may not understand...

    i'm not good at english, you may not understand the words i written,so i thinked the code is the best way to express my thought.

    sorry, i will do my best to explain , and not just post the code
  24. Replies
    15
    Views
    6,053

    oh, that's my mistakes, when i found...

    oh, that's my mistakes, when i found scanf("%lf",.....) will eliminate the error, i change the float to double, and send the code to my GF, but before i post the code , i change the double to the...
  25. Replies
    15
    Views
    6,053

    oh,sorry, i deleted the [i] uncarefully when i...

    oh,sorry, i deleted the [i] uncarefully when i post the code
    my source code is scanf("%f", &stuArray[i].chinese) .........
    and it take runtime error

    but change them to scanf("%lf",....) , the...
Results 1 to 25 of 35
Page 1 of 2 1 2