cuz I wasn't here genius. The only reason I decided to post was I was reading what looked like an interesting thread and then I saw you insult everyone who was nice enough to try and help you.
No,...
Type: Posts; User: Crimpy
cuz I wasn't here genius. The only reason I decided to post was I was reading what looked like an interesting thread and then I saw you insult everyone who was nice enough to try and help you.
No,...
Random numbers are a ***** to get right, and you can't expect everyone to use the best algorithm. rand is standard and every implementation meets the requirements, but that doesn't mean they're all...
In C++ the typedef is implicit, you don't have to worry 'bout it.
Someone did post it, if you're not smart enough to understand the code you've been given, that's not our problem. Cela's code does exactly what you asked, it has a virtual base function and a derived...
How the hell should I know? All I know is that of several different operating systems I've used, all of them run faster with buffered input than with character by character. Or to spell it out since...
That's between you and your system, buffered input is almost always faster than character by character input.
That was my point entirely, your way printed 2 with a 3 line file that didn't end in a...
C++ really isn't any better, but you can be reasonably sure that you'll use most of C for any given program where with C++ you won't even use 15% of the language even for huge programs. You can know...
std::ifstream fin("file.txt", std::ios::in);
int lines = 0;
char c;
do
{
fin.get(c);
if (c == '\n')
++lines;
Because you're taking without giving anything back. We want to know that you're trying, otherwise it's a waste of time helping you out and we have better things to do.
Yea, but you can't quantify exactly what the difference is, so twice as much as as good as any for a "Duh" question like that.
A double precision variable has twice the precision of a single precision variable. Isn't that kind of obvious?
Dynamic data structures like linked lists and binary trees are best made with pointers. You can use pointers to pass big objects around without worrying about copying them. You can use pointers to...
Right, you overload << for ooint to act on an ostream
ostream& operator<<( ostream& os, const ooint& stuff )
{
//print stuff
}
then you can do stuff like cout << a << endl because cout...
do you have an overloaded = like this?
ooint operator=( int rhs )
If you do then it's all good
Works good for me
#include <iostream>
#include <list>
using namespace std;
template<class T>
void PrintList( const list<T>& l )
You don't, int + int is built into the compiler, so it does everything for you as long as ooint has an overloaded = operator that takes an int.
in C++ a structure and class are the same except a class is private by default and a structure is public by default. There's no comparison with a C structure because it can't have methods, just...
Look dude, you have to overload an operator for every type you want to use it with, if you want to do ooint b = a + 1; then you've got to define
ooint operator + ( const ooint & lhs, int rhs )
If...
A hash file? That's weird, but you can try using fseek, I'm not sure, but this works for me.
#include <stdio.h>
int main( )
{
FILE *fp;
char rec[100]; // Record size is 100
...
Your compiler is protecting you from yourself. Just because it works doesn't mean it's right.
void main() is wrong, int main() is right. That's the difference. Even if it seems like its working...
Question - When writing an operating system, isn't it required that stuff like the boot loader has to be written in assembly? Or can it be written in optimized C and still work?
Cheers! :)
No, you can't. If this scares you then send XP to the bit bucket and go get Linux.
Cheers! :)
I guess it's good to learn if you wanna speed up your programs, but from what I've seen, all inline assembly does is give you quick access to the hardware if your operating system allows it. I think...
I don't have that book, but if you send me the questions then we can still do them together if you want. I don't usually have much better to do with my spare time except learn other languages and...
Maybe the cause of so many on-posters is because they registered and then either didn't choose to come back or they had no way of deregistering for whatever reason. How about a time limit for new...