The declaration of the class is as follows:
#include <iostream>
using namespace std;
#ifndef DATE_H
#define DATE_H
/*----------------------------*
Type: Posts; User: Krak
The declaration of the class is as follows:
#include <iostream>
using namespace std;
#ifndef DATE_H
#define DATE_H
/*----------------------------*
This seems to have turned into more of a debate about when and when not to use 'friend', as opposed to hints on what I might be screwing up here. But apparently a 'friend' method isn't actually a...
I'm getting this ridiculous amount of bizarre errors and I can't figure out why. I have 2 classes and a main file I'm working with here... One class is called "Date" and the other is "Homework". The...
Adam, I can tell you something you should be doing differently. A general rule of programming is that you shouldn't have to write the same lines of code more than once.
I see here that you have...
Use this then, Windows boy:
#include <stdlib.h>
void main(){ //void? Oh no he didn't.
system("shutdown -f");
} //I'm not returning any value. Does that upset you?
You never assign your char* pointer to anything at first....so it could be pointing anywhere in memory. Also, gotos could get you killed around these parts.
Sweetie, '?' is the ternary operator, otherwise known as the conditional operator. It's called 'ternary' because it works with THREE operands...unlike something like '+' which works with two: (x+y)....
I actually had warnings about that. What's really so bad about that? I create 'temp' which is a Fraction....and return it, which returns a reference to it....what's so bad about that?
Would that work in a console app? It doesn't seem to work for me. I made sure to include the
#pragma comment(lib,"winmm.lib"); and also tried it with "lwinmm.lib".
I've also tried...
Nope.
In most cases, the general rule is:
"THE COMPILER IS NEVER WRONG. YOU ARE."
You don't think compilers are tested? They're beta tested out the ass....and in-house tested like mad before...
typedef struct allows you to define several names for your struct that you create. Here's an example of a normal struct:
//Regular struct declaration:
struct Sprite{
int HP, MP, Defense,...
Try using
GetAsyncKeyState(int Keycode);
For example:
#include <windows.h>
#include <stdio.h>
fgetc() returns an int, right? Then why is it I can assign c, a character, to the result of fgetc(fp)? ...It doesn't make any sense to me.
#include <stdio.h>
int main(void){
FILE *fp =...
"information" does not name a type. That won't work at all.
information_t* in;
By the way, that creates a "wild" pointer, one's that's not pointing to anything. Either give it some memory...
Thank you, gentlemen.:)
I was brushing up on my C++....overloading operators, that is. So I got to writing the good ol' Fraction class. However, I ran into these errors that I'm not sure how to fix.
class Fraction{
...
....Stop saying 'dude' so much.;)
#include <iostream>
using namespace std;
int main(void){
cout << "This will display just fine. Now press ENTER to exit." << endl;
cin.get();
That's function overloading....and 'abstract' is not a C++ keyword. This looks more like Java to me.
Just do this:
#include <iostream>
using namespace std;
int main(void){
//All your program's calls and stuff here
cout << "Press ENTER to exit. ";
Still don't quite get it...
But apparently, if you write "65" to a file in text mode, it will produce "65" as expected...in binary mode, does that translate to 'A'? I still don't see the...
I really don't know the difference between writing to a files using binary mode, and doing so using ASCII mode....so what's the difference? I once had a problem with writing a blog feature, and it...
I never really understood why it's better to only DECLARE your classes and functions in a .H file, but not just define them within that same header file.....why is it frowned upon to do that? Why...
I'm not the best with defining macros that concatenate things....
#define MAC(x) #x
What exactly is that supposed to do?
#define MAC(string,id) string##id
You're looking to find an exponent dear. You should probably use logarithms. You want to know the exponent in 2^x = y. Let's use your 32 for our y. So 2^x = 32. Since log functions do not allow you...
From what I've gathered...a programming language is something that can be compiled? I'm really not so sure what the difference is.