fprintf(), IIRC, writes everything to a file. If you want to read from a file, I believe you want to use fgets().
Type: Posts; User: Zach_the_Lizard
fprintf(), IIRC, writes everything to a file. If you want to read from a file, I believe you want to use fgets().
Your if statements, to my eyes, are incorrect.
if (date_c[ii] !(<"0" || >"9"))
What does this statement mean? Nothing to me. Perhaps you meant something like this:
if ( date_c[ii] <...
Wow, 349 pages of documentation. Ouch. I think your professor is asking too much. Reading a TGA file might be more inline with "Intro to C++" than reading a ridiculously complicated file type.
I suppose one way you could do division is to use the basic long-division algorithm that we all learned at school. Another way to do division might be the Newton-Raphson method for division.
The...
If I understand what you want correctly, you have a fixed area in which you can write text. Having never worked with the various console graphics libraries, I will make the assumption that the area...
I believe what you want is std::getline, not cin.getline. The cin version takes an array of chars, IIRC, while the std::getline version takes an input stream and a string. It optionally takes a...
Whether your assignment was due in 2003 or 2009 on October 2nd, it's still late.
Anyways, let's assume you write each name on a separate line. All you'd need to do is this:
...
I second the suggestion that you brush up on some basic arithmetic. I would also second the suggestion you look into modulus. Here's a very suggestive hint:
122 mod 10 = 2
Apologies for the double post, but I've successfully built the core Qt libraries using Visual Studio 2010 installed in the default path. This is how I configured it:
configure -platform...
I don't recall having any trouble building Qt with MSVC express a few weeks ago. The configure and build script just worked right out of the box. I only have the 2010 beta of Visual Studio, so let me...
Aha! You have left out the truly best answer: GCC for Windows. All other compilers are inferior in every possible way....*ducks*:p
In all seriousness, if I were developing for Windows, I'd...
First off, fix your indentation. It's a pain to have to read code like that. Second off, your scanf() function will do two things: Firstly, the way it is written now, it will not compile. Secondly,...
A C++ compiler in BASIC? I think that's sacrilege, or something worse.
In any case, I think this TI Basic tutorial site might be right up your alley.
It appears to work OK from my testing, but I would change it to inform you it's wanting your input. I also prefer seeing stuff in radian measure than degrees, but that's just me.
Pi is a mathematical constant. 3.14159.....
Just follow what Epy said, and you shouldn't have any trouble getting the angle to your target.
EDIT: Check this page out for more on PI:
...
It's been a while since I've used SDL, back during the dark days when pointers were terrifying beasts that caused programs to crash, compiler errors were written by an alien race, and comments for...
You can probably use a regular expressions library to find a specific tag. The new C++ standard will have a Regex library, which is actually the Boost.Regex library. VS 2010 probably has it, and GCC...
It depends on what sort of graphics library we're talking about. If we're talking about 3D, you have a variety of choices, such as DirectX (Windows only) or OpenGL (cross platform) or SDL (which uses...
I don't think it'd be so horrible if he's looking for, say, a specific tag, such as <ul>. It's certainly doable, considering Webkit and Gecko are written in C++, and they have to do far more than...
Another thing you can do with C++0x lambdas is have local functions within your function. You could do something like this:
#include <iostream>
#include <vector>
#include <functional>
using...
You could try using Qt Creator, which they probably have for Mac OS X. If projects in that don't work, then something got screwed up during install or something.
The last printf statement has an error. It's not one you would think of right of the bat, but the string is broken up into 2 lines, and it treats it as though each line is a totally separate...
I would use a for loop. Just have it start at 100 and end at 70.
That would be one of your (potential) issues, yes. The other issue is previously mentioned: sum /= 2 might be okay, but then you went ahead and put it in a for loop. It will continuously divide the...
You're right about arctan(x), and right about sin(x), but wrong about sin(atan(x)).
-(x^2/(1 + x^2)^(3/2)) + 1/sqrt(1 + x^2) is the derivative. You have to use the product rule and the chain rule