Search:

Type: Posts; User: spoon!

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: Strings In C...

    by spoon!
    Replies
    5
    Views
    1,116

    const char *p; int index; if ((p = strchr(x,...

    const char *p;
    int index;
    if ((p = strchr(x, 'e')) != NULL)
    index = p - x;
  2. Replies
    17
    Views
    3,482

    scanf("%s",&filename1); scanf("%s",&filename2);...

    scanf("%s",&filename1);
    scanf("%s",&filename2);

    filename1, filename2 are single characters; a string can't fit in a character. you need a character array that has at least (length of input)+1...
  3. Replies
    14
    Views
    6,608

    according to...

    according to http://www.boost.org/libs/smart_ptr/shared_ptr.htm
    testp.get()
  4. Replies
    3
    Views
    1,293

    int sumrow[5] = {0}, sumcol[5] = {0}; for...

    int sumrow[5] = {0}, sumcol[5] = {0};

    for (x=0; x<ROWS; x++)
    for (y=0; y<COLS; y++) {
    sumrow[x] += val[x][y];
    sumcol[y] += val[x][y];
    }
  5. Replies
    8
    Views
    1,519

    element is a local variable of retrieveSub....

    element is a local variable of retrieveSub. modifying it is useless, it won't affect anything else

    maybe you wanted to modify what it pointed to? or something?
  6. Replies
    2
    Views
    1,719

    google for SSH with keys

    google for SSH with keys
  7. Replies
    9
    Views
    1,344

    from wikipedia: "Includes the IIS web server,...

    from wikipedia:
    "Includes the IIS web server, fax support, Rights Management Services (RMS) Client, file system encryption, dual processor (two sockets) support, system image backup and recovery,...
  8. Replies
    14
    Views
    1,265

    no, they mean using malloc() to allocate memory...

    no, they mean using malloc() to allocate memory on the heap (which is larger and it tells you if the memory allocation fails)
  9. each process has a task_struct; which processes...

    each process has a task_struct; which processes do you want to access information for? I think usually only the kernel has access to this

    process information is also available in the /proc...
  10. Replies
    5
    Views
    4,603

    both should be okay

    both should be okay
  11. Replies
    15
    Views
    1,955

    the first time you pressed return after the...

    the first time you pressed return after the number, the "cin>>numGroups" only retrieves the number, and the newline stays in there

    so the next time you call cin.getline(groupname,30), it retrieves...
  12. by default, members of structs have public...

    by default, members of structs have public accessibility and public inheritance, and members of classes have private accessibility and private inheritance
  13. Thread: counting steps

    by spoon!
    Replies
    6
    Views
    7,780

    a while loop is probably better, so that it works...

    a while loop is probably better, so that it works for a = 1

    also, inside the loop, you probably want to assign the things back to "a", like "a = a/2" and "a = a * 3 + 1"


    int steps(int a)
    {
    ...
  14. Replies
    10
    Views
    2,674

    This is extremely inefficient though.

    This is extremely inefficient though.
  15. Replies
    10
    Views
    1,772

    insert 1000 values into a max-heap, and then...

    insert 1000 values into a max-heap, and then extract the maximal element 10 times
  16. Replies
    3
    Views
    976

    you put a function call in the initializer list?...

    you put a function call in the initializer list? that doesn't make any sense; did you mean this? the answer is generally yes (there are some obscure exceptions).


    class someclass {
    public:...
  17. Replies
    18
    Views
    3,018

    i dunno, it appears to work does it tell you...

    i dunno, it appears to work

    does it tell you what the problem is? compile error? wrong output?

    in case they were picky for some reason, here are some things you might try:
    * change "long long"...
  18. Replies
    5
    Views
    3,773

    You want a "set", which is an associative...

    You want a "set", which is an associative container. there are two implementations for associative containers.

    One is the self-balancing binary search tree, which is sorted and gives a O(log n) to...
  19. Thread: Linked lists

    by spoon!
    Replies
    4
    Views
    1,300

    http://en.wikipedia.org/wiki/XOR_linked_list

    http://en.wikipedia.org/wiki/XOR_linked_list
  20. Replies
    13
    Views
    1,300

    The first one has some issues though. b is first...

    The first one has some issues though. b is first constructed using the default constructor, which might have undesirable side-effects. Also won't work if you only have non-default constructors, and...
  21. if you don't include anything, it will give an...

    if you don't include anything, it will give an error; to show that it indeed does complain

    int main() {
    return INT_MAX;
    }
  22. some of your other headers included it

    some of your other headers included it
  23. Replies
    18
    Views
    3,018

    can you explain what all this is supposed to do?...

    can you explain what all this is supposed to do? and why you think it accomplishes the task?
  24. Replies
    2
    Views
    1,060

    try putting the operator functions outside of the...

    try putting the operator functions outside of the class declaration, since they are not part of the class

    edit: there are two ways of doing operator overloads. The first is as an instance method...
  25. Replies
    4
    Views
    1,110

    there's a system() function in stdlib.h

    there's a system() function in stdlib.h
Results 1 to 25 of 32
Page 1 of 2 1 2