Aren't you already doing that by the "if" statement? I mean do that complicated maths on Y if Y < 0.2.
Type: Posts; User: chameleons
Aren't you already doing that by the "if" statement? I mean do that complicated maths on Y if Y < 0.2.
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...
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).
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
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".
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...
You can't do that with arrays. The allocation is done once and only once.
However, you can do that with vectors.
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...
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...
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...
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...
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.
"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...
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...
if the 0th element has not been written yet, it will be the value created by the default constructor of "string" class.
no you can't. Inventory[0] in this case is of type "string".
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...
what do you mean by constraint?
btw, google is your friend, here's one big integer library
https://mattmccutchen.net/bigint/
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...
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...
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...
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());...
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.
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...
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...