Forum: C++ Jun 2nd, 2009 |
| Replies: 13 Views: 913 To make it a more secure method, you could do a binary write to the file with the time of day (in clock ticks) that the file was written, the number of guesses that occured, and a strange binary... |
Forum: C++ Apr 28th, 2009 |
| Replies: 35 Views: 2,052 This would require a data aquisition card, an instrumentational amplifier attached to a very sensitive inductor, and amplified so that the minute changes in electrical forces in the air generate a... |
Forum: C++ Apr 28th, 2009 |
| Replies: 35 Views: 2,052 Umm...What point was made, exactly, with that post?
and kelechi96,
don't get discouraged too much, some of the people around here can be a little ignorant at times, but will usually help you out... |
Forum: C++ Apr 28th, 2009 |
| Replies: 11 Views: 502 I would sugguest attending class. |
Forum: C++ Apr 28th, 2009 |
| Replies: 35 Views: 2,052 An example of this would be to measure the amount of electrical energy in the air at any given point using some sort of analog device, which then converts this into a voltage difference, which is... |
Forum: C++ Apr 24th, 2009 |
| Replies: 1 Views: 387 Do you have to use sscanf? That's a bit outdated and not generally used, and MSC++ throws a bunch of warnings when you use it. I sugguest using string datatype with operator+()
Usage:
... |
Forum: C++ Apr 24th, 2009 |
| Replies: 25 Views: 1,724 Your function makes little to no sense to me. Just think about injecting test values into it. Say you pass it 5, base 10:
5 / 10 = 0.5 = 0 (int)
"0123456789abcdef"[0 % 10] = '0'
Well damn. ... |
Forum: C++ Apr 24th, 2009 |
| Replies: 4 Views: 304 std::cout << "What did you get on this assigment? ";
std::cin >> iMark;
if (iMark == 0)
return false;
else
return true; |
Forum: C++ Apr 24th, 2009 |
| Replies: 2 Views: 889 Hmmm seems like you need to bust out the math book. I honestly dont remember the math functions in CMath, but you should probably look it up. I also don't know how the library you are using... |
Forum: C++ Apr 24th, 2009 |
| Replies: 8 Views: 628 Wow that is just too painful to read. Curly brackets all over the place. Fix it up a bit please. |
Forum: C++ Apr 24th, 2009 |
| Replies: 4 Views: 340 Hmm I'm not to familiar with that command, but it could have something to do with Vistas rediculous overhead such as data execution prevention or some other security 'feature' |
Forum: C++ Apr 24th, 2009 |
| Replies: 46 Views: 2,390 Usually people that code in C++ don't want things done for them that they don't have control over. If you really want something that nulls and deletes a pointer, write it yourself.
As for a... |
Forum: C++ Apr 24th, 2009 |
| Replies: 4 Views: 443 Simple sentinel loop:
cin >> x;
while (cin.fail() || cin.rdbuf()->in_avail() > 2)
{
cin.ignore(cin.rdbuf()->in_avail());
cin.clear();
cout << "Invalid input\n";
cin >> x; |
Forum: C++ Apr 24th, 2009 |
| Replies: 4 Views: 443 I think the main problem with your loop is...you don't have a loop.
Also...when checking the value of a bool it is better practice to either compare it to a bool value or just the actual bool... |
Forum: C++ Apr 3rd, 2009 |
| Replies: 19 Views: 1,916 Oops. You also need to put an empty cin.get() after that line:
cin.ignore(cin.rdbuf()->in_avail());
cin.get();
return 0;
The first line flushes the input buffer, so that it doesn't cause... |
Forum: C++ Apr 3rd, 2009 |
| Replies: 19 Views: 1,916 Well as for the actual palindrome detecting algorithm, I don't think your code will work. Instead, I think you need to use deques of chars. I'm not all that comfortable with deques, I've maybe used... |
Forum: C++ Mar 24th, 2009 |
| Replies: 4 Views: 232 ??? He was asking you a question relating to your problem. Albeit a bit rudely, it would probably be best (for your sake) to answer his question. You need to be more clear when asking questions in... |
Forum: C++ Mar 23rd, 2009 |
| Replies: 4 Views: 232 Google It? (http://tinyurl.com/dhssuz) |
Forum: C++ Mar 23rd, 2009 |
| Replies: 13 Views: 714 lol? You never even posted problem to begin with. |
Forum: C++ Mar 14th, 2009 |
| Replies: 6 Views: 382 Are you trying to teach yourself c++? If so you need to find a very basic guide that takes you down to the fundamentals of the language to start constucting your knowledge foundation upon. Learn... |
Forum: C++ Mar 13th, 2009 |
| Replies: 6 Views: 382 What do you mean to update it in the main form? You need to insantiate your class in the main form, and have a member function in the class which will return data to main. An alternative to this is... |
Forum: C++ Mar 6th, 2009 |
| Replies: 18 Views: 692 Did you just say you chat raped me? That's a little obscure. |
Forum: C++ Mar 5th, 2009 |
| Replies: 4 Views: 305 For loops are designed mainly for integer incrementation. They support other datatypes, but this will often result in confusing problems like this. Instead, use a while loop.
while (i!=NULL &&... |
Forum: C++ Mar 5th, 2009 |
| Replies: 6 Views: 700 I don't understand why your are interchanging null terminated c style strings with the String class. The string class alone should suffice here and it handles its own memory (and also contains an... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 4 Views: 2,152 If it's a double linked-list it would make finding items past the half-way node more efficient,if you knew you where specifically looking at the end of the list, but finding an item in the middle... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 22 Views: 1,038 I think he means a min-max tree concept, where the starting node would be the starting position, each leaf would be a possible place to move to, which would leaf out also into further possible paths... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 4 Views: 454 Yeah if you want to work on macros that's one thing, but if you only want to accomplish the goal of auto-filling web forms then yeah you should really create a whole system with an XML file (or even... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 18 Views: 692 Hey thrashing the thrashers is just as hypocritical as hating all racists. |
Forum: C++ Mar 2nd, 2009 |
| Replies: 22 Views: 1,038 I think i may understand your problem. You have a grid (not a function) where points can be all over the place , and you need to find the shortest path. Sorry for misunderstanding. I will think up... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 22 Views: 1,038 That really isn't anymore descriptive. If all nodes must be passed, then there is no shortest cycle, they will always be the same, unless your definition of cycle is different than mine. Mine is:... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 22 Views: 1,038 What do you mean the shortest cycle? What makes a cycle? I imagined you where iterating through each point, making sure that the next x is greater than the current, which is essentially just... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 4 Views: 2,152 Linked lists are always the slower option, as all items must be iterated to find the end. A well written hash table or binary map will give you the speed you seem to be looking for. |
Forum: C++ Mar 2nd, 2009 |
| Replies: 5 Views: 298 Ahh yes that makes sense. Not too sure why you would need to do something like this, could you post the context of your problem? |
Forum: C++ Mar 2nd, 2009 |
| Replies: 18 Views: 692 Use a for loop. And show some freakin effort! |
Forum: C++ Mar 2nd, 2009 |
| Replies: 3 Views: 369 You will also probably want to send the size of the array, unless you plan on writing an algorithm to look for the null terminator. |
Forum: C++ Mar 2nd, 2009 |
| Replies: 5 Views: 298 Wouldn't you just end up with this then?
a.b->a.b->a.b->a.b to the end of the universe? |
Forum: C++ Mar 2nd, 2009 |
| Replies: 4 Views: 454 Ummm. I have no idea what you are trying to do. And I don't think that all those mouse events are relevant to the problem, and should probably not be included for clarity. Are you trying to write... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 22 Views: 1,038 #include <vector>
#include <algorithm>
struct Point
{
public int _iX, _iY;
Point(int x, int y)
{
_iX = x;
_iY = y;
} |
Forum: C++ Mar 2nd, 2009 |
| Replies: 5 Views: 381 here's a brute force template
for (int i = 0; i < MAX_NUMBER; i++)
{
if (Condition[i] == Desirable)
DoFunction();
else
DoOtherFunction();
} |
Forum: C++ Jan 27th, 2009 |
| Replies: 8 Views: 650 I disagree with rashakil. Using pointers properly can greatly increase the efficiency and speed of your code. Just compare C++ to C#. C++ programs run much much faster than C#, because C# doesn't... |