Recent content by Linda8888

  1. Linda8888

    Comp Sci What is the Best Way to Use Namespaces in C++?

    using namespace std; using vit = vector<string>::iterator; void print(const vector<string>& s) { for(vit it = s.begin(); it != s.end(); ++it ) { count << *it << endl; } }
  2. Linda8888

    Question for strcpy and pointer

    Summary:: Question: In the blank space below, write a new version of the first line of this code segment such that the strcpy succeeds. Use only stack memory and try not to waste memory. how can I change the first line of the code? char *s1; // change this line char *s2 = "good luck"...
  3. Linda8888

    Question for a pointer code fragment

    [SIZE=16px] Thanks for replying! Why are the first output 432 and the third 1024? How do those work?
  4. Linda8888

    (C language)why does this code fail to compile

    Thank you all. I got it!
  5. Linda8888

    (C language)why does this code fail to compile

    does main.c forgets to include <stdio.h>?
  6. Linda8888

    Question for a pointer code fragment

    (I am not sure what does "(MyType **)" means after the '=' sign at the second line) The output is :
  7. Linda8888

    (C language)why does this code fail to compile

    // MyStruct.h typedef struct { int a; float b; char c; } MyStruct;// HisStruct.h #include "MyStruct.h" typedef struct { MyStruct a; int b; } HisStruct;// HerStruct.h #include "MyStruct.h" typedef struct { MyStruct a; float b; } HerStruct;// main.c #include "HisStruct.h" #include...