Search:

Type: Posts; User: chameleons

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,706

    Aren't you already doing that by the "if"...

    Aren't you already doing that by the "if" statement? I mean do that complicated maths on Y if Y < 0.2.
  2. Replies
    5
    Views
    1,706

    Can you please post the segment of the program...

    Can you please post the segment of the program that you have problem with? I have difficulty understanding how Y represents the line segment, and thus could not think of any idea to solve your...
  3. You are supposed to return an integer pointer,...

    You are supposed to return an integer pointer, not an int. According to my understanding of the meaning of this function, just return (x+temp).
  4. Replies
    2
    Views
    4,058

    Do you mean the International Olympics in...

    Do you mean the International Olympics in Informatics? If so, just google IOI with a year number, like "IOI 2010", and then you could get your hands on IOI 2010's tasks,

    IOI 2010 - Competition Task
  5. Replies
    2
    Views
    1,150

    I suggest that you just google "printf". There...

    I suggest that you just google "printf". There are plenty of references on what it's about.
    As far as I know, there's no tool for converting "printf" to "cout".
  6. Replies
    1
    Views
    828

    A Binary Tree is a general data structure, not...

    A Binary Tree is a general data structure, not some C++ thing. You could implement a binary tree in C++. You can google or wiki binary tree. As for inserting a node, umm... usually a node is...
  7. Replies
    11
    Views
    1,163

    You can't do that with arrays. The allocation is...

    You can't do that with arrays. The allocation is done once and only once.
    However, you can do that with vectors.
  8. Replies
    2
    Views
    956

    a few problems to fix: 1) when you compare two...

    a few problems to fix:

    1) when you compare two strings stored in "char" arrays, it's not sufficient to compare the first characters of the two strings, as done here
    *p[i] > *p[i+1] , you should...
  9. Replies
    5
    Views
    2,691

    well, you forgot to enclose the two statements in...

    well, you forgot to enclose the two statements in the while loop with curly brackets. As such, only the first statement is considered to be in the while loop, whereas the statement where i increases...
  10. Replies
    1
    Views
    841

    To communicate securely with a server, you need...

    To communicate securely with a server, you need some encrypted connection. The standard one is SSL. There is an open source library for it here:

    OpenSSL: The Open Source toolkit for SSL/TLS

    If...
  11. Replies
    9
    Views
    2,378

    when you input two numbers, separated by space,...

    when you input two numbers, separated by space, followed by the "Enter" key, you effectively put in stdin stream the following characters "1 2\n". If you don't put "\n" in your scanf", the carriage...
  12. Replies
    14
    Views
    1,532

    Oh in that case, "Inventory[0].empty();" actually...

    Oh in that case, "Inventory[0].empty();" actually does work, since the class "string" has this method too, and since the default strings are empty, if it's empty, it means it's not written yet.
  13. Replies
    9
    Views
    1,427

    "long selection = ((row * col) * prec)/100;"...

    "long selection = ((row * col) * prec)/100;"
    Even if your compiler's "long" is 64bit, and can store 10^10, this will not work, because all of the operands are int, the result will be truncated to...
  14. Replies
    14
    Views
    1,532

    what do you mean by "there's already stored in a...

    what do you mean by "there's already stored in a vector element", are you trying to check if the 0th string is written? Then you can compare the 0th element with a string created by the default...
  15. Replies
    14
    Views
    1,532

    if the 0th element has not been written yet, it...

    if the 0th element has not been written yet, it will be the value created by the default constructor of "string" class.
  16. Replies
    14
    Views
    1,532

    no you can't. Inventory[0] in this case is of...

    no you can't. Inventory[0] in this case is of type "string".
  17. you mean, you use the std string library for...

    you mean, you use the std string library for concatenation, but you need the file name stored as a character array for opening the file, is it?
    If so, then you could use the "c_str" function from...
  18. what do you mean by constraint? btw, google is...

    what do you mean by constraint?
    btw, google is your friend, here's one big integer library
    https://mattmccutchen.net/bigint/
  19. Replies
    4
    Views
    3,469

    I think it's unlikely that there are libraries...

    I think it's unlikely that there are libraries that can help you do it.
    What you could do is to output your results into a Latex file, usually with ".tex" extension. Latex like HTML, is a markup...
  20. Replies
    1
    Views
    1,334

    suppose you have "N" student records, stored in...

    suppose you have "N" student records, stored in array "stu[]", now you want a linked list with "head" as the pointer to the first element of the list, then



    StudentListNode *ptr = head = new...
  21. Replies
    2
    Views
    11,660

    You need to cast your char to unsigned char...

    You need to cast your char to unsigned char first, as the RGB values can range from 0~255, which is the range of unsigned chars. Signed chars' range is -128~127. When a RGB value is greater than or...
  22. yea, stringstream. that's a nice solution. For...

    yea, stringstream. that's a nice solution.
    For example, you collect the words into the vector "result", then for each line[i], you could



    string temp;
    istrstream in(line[i].c_str());...
  23. Since your data are all double-words and no...

    Since your data are all double-words and no values span across DW boundaries, I suppose you could use the x64 instruction set, with its 64-bit registers. That'll be a whole lot easier.
  24. You do not have to delete any elements from any...

    You do not have to delete any elements from any lists. You just have to advance the head pointers, isn't it. Whenever an element has been processed, whether it's in the first or second list, just...
  25. Replies
    5
    Views
    1,282

    Oh. I got what you mean. You want to eliminate...

    Oh. I got what you mean. You want to eliminate unnecessary spaces that users might have keyed in. Is that right?

    Ok, the simplest solution is to use string stream.

    Suppose that you captured the...
Results 1 to 25 of 33
Page 1 of 2 1 2