Use winsock and connect to a time server?
Type: Posts; User: TerranFury
Use winsock and connect to a time server?
If you program in a protected mode environment like Windows, the chances of writing to memory and screwing something important up are just about zero.
You keep a pointer to the first node. Then, you go from node to node until you reach the end node, whose "next" pointer is NULL. That's all there is to it.
Here's some sample C++ source that may...
int num;
if(cin >> num)
{
cout << "It's a number!\n";
}
else
{
cout << "It's not a number!\n";
}
Basically, think C without pointers or bit-shifting, with a string data type, and with arrays that can be re-allocated. Then think of each branch of the switch() statement you'd put in your message...
I taught myself C++ by going to websites and exerimenting. Though I've still got a little ways to go in terms of OO design, I can write relatively well-organized code to solve most problems.
I...
I believe those tutorials are by NeHe and instruct the use of OpenGL under Windows.
I think the reason you're not getting any replies is because nobody can read your code. Try putting it in [ c o d e ] tags (but without the spaces of course) and use proper indentation so that...
Basically how it's done:
bool isdigit(char c)
{
if(c >= '0' && c <= '9')
return true;
return false;
Think of recursive functions as boxes within boxes. Your function was as follows:
int Fibonacci(int N)
{
if ((N == 1) || (N == 2)) // base cases
return 1;
...
When you do something like this:
char x[823];
The array is allocated on the stack. The stack is not very large. If you do this, however:
char * x = new char[823]
...then it is allocated...
I remember seeing a program that would take a DOS EXE file and output C source for it. I never tried it, but I do know that there was a bug in it such that it could only decompile small programs. ...
Conditionals invariably involve jumps; I understand that. Why then add the additional jump of a goto? You say that conditionals involve tests whereas gotos do not, and you're right. However,...
The jmp family of instructions should be avoided whenever possible. They will cause the pipeline to stall. On x86 architectures, especially the new PIII and PIV CPUs, these and cache misses are...
Sure, programmers work in hex, but the theory behind modern computers is still founded on the base-2 number system.
Anyway, back on topic:
Go ahead, learn Java. The more you know, the better. ...
If x is an integer, (cin >> x) evaluates to false if the input is non-numeric. Example:
[code]
int x;
cout << "Enter a number: ";
if(cin >> x)
{
cout << "You just input the number " <<...
using an unsigned _int64 would give you the best results if you're only using positive numbers. If you need something even bigger, then you may have to code a class that strings together a whole...
There's also the really slow unportable way:
system("cls");
lol
If you have a "stable" sorting algorithm, then, to use an example, if you sort wage, and then hours, and then dept. number, you'll get output something like this:
DEPT # ...
There's a command in x86 ASM to do the wrap-around shifting, but I forget what it is...
float myInput;
cin >> myInput;
if(myInput == (int)myInput)
cout << "You entered the integer " << myInput;
Nibbles!!! (the snake game)
There exist formulae which can solve quadratic and cubic equations. It is mathematically impossible for a simple formula to exist to solve quintic (not sure about quartic) polynomial equations.
...
EDIT: That should be "sld" instead of "std" in the above ASM.
I was curious to see if there was any way to do strcmp in ASM other than the method that the standard strcmp uses. It seems that the ASM operation "cmpsb" can be useful for quickly comparing strings...