#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
void getdata(char name[], double &gpa)
{
Type: Posts; User: The Doctor
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
void getdata(char name[], double &gpa)
{
Policy on this forum is that the user should attempt their homework before asking for help.
Please try to do it yourself, and if you have any questions, feel free to ask for help.
We will not...
http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDoQFjAB&url=http%3A%2F%2Foopd-assignment.googlecode.com%2Ffiles%2FOOPD110Book%282%29.pdf&ei=0NCiUZy6MuPniAeszoFY&usg=AFQ...
I am not familiar with .lib files, but a .h file should contain the declarations of certain functions. Use these functions in your program to achieve the result you need.
perhaps the .lib file is...
They aren't variables, they're custom Data types. ( they're structs, and I've used typedef so I don't have to type struct Instruction everywhere).
I first learned to program in Java, so I like...
Hey guys, is there an easy way in gdb, to keep track on the value of one particular instance of a struct?
Even if I could keep track of each instance of the struct at all points it is accessed...
This is part of a Uni assignment, and the coding style I was taught was to cast it back to the specific type anyway, so that's the style I will follow. ;)
Boy is this bug annoying... You really...
/*
* Instruction_t - stores a specific instruction
*/
typedef struct
{
/*
* action - CPU or IO
*/
Action_t action;
My advice on looking up char arrays still holds though.
We won't do your homework for you, mate. That wouldn't help you in the long run.
I'll give you a hint: Character strings are implemented as char arrays in C. That might be what you need to know.
...
I tried to compile your code (removing line 37) and it compiled. It just didn't remove the vowels.
I suspect your use of some of the string functions is wrong. Perhaps you should look up how those...
Line 37.
enteredword = word;
Is there any reason you need that? Unless I'm mistaken that line sets "enteredword" equal to a variable called "word", which does not exist in that scope (the...
Ummm....
A couple of points:
1. Divide the program into modules. Use functions (subroutines) to eliminate having to write the same thing over and over again. Consider using classes if you know...
Look up Preprocessor commands. That's what you need to use.
You want the volume thing to not be a function. you need to use #define for a macro as well.
Okay, I've adjusted the code further... The only preprocessor constant left is VERSION, as I saw no need to put that in the Grid class.
I'm tempted to put them in a separate class of themselves,...
Sorry for the double post, but here's V1.4 if anyone's interested:
Main.cpp:
#include <iostream>
#include "grid.hpp"
using namespace std;
Thanks to both laserlight and whiteflags. The code is working a lot better now.
This is the first I've heard of "const correctness", I guess I'm going to have to do some research on that too. I...
Thanks for the advice. I might fiddle around with the program later.
As I indicated in my post, I'm coming from a Java background, and so some of the concepts in C++ are new to me.
I have heard...
boxes is declared as
boxes = new char[8];
EDIT: Hang on a minute????? I declared it as only having 8 characters, and yet it seems to still be working fine! I'll go and fix that now...
I kind of wanted to brag about my first real C++ program. I know it's simple, but I just am really happy about it.
While you're looking at it, if you see something I could have done better, please...
Oh man, I feel so stupid!
I just realized that I should have been &&'ing rather than ||'ing on line 14. *FACEPALM*
Greetings, you may know me from my posting in the C Forums.
Having basic knowledge in Java, and thus a basic knowledge in Object Orientation, I decided to give C++ a go.
I decided to make a...
Can you explain why it is evil? I don't see a problem with it. (Though I am admittedly new to C)
Just compiled on another computer, and it compiled fine. There might be something wrong with my math library. Any suggestions on how to fix it?
Also, I actually don't have a LDFLAGS variable......
Why haven't I needed to do that so far? And could I do that in the Makefile?
EDIT: I added that to my $(CFLAGS) variable in the makefile, and it still comes up with the same error.
Here's my...