Thanks, I'll give it a shot. I'm not quite to the point where I can test it, because I'm still transfering things from the RentalSystem to main, cleaning it up in functions, etc; the dirty work. ...
Type: Posts; User: ChristianTool
Thanks, I'll give it a shot. I'm not quite to the point where I can test it, because I'm still transfering things from the RentalSystem to main, cleaning it up in functions, etc; the dirty work. ...
Yes, they all derive from Car. My plan was to do something like
Car* newCar = 0;
if ( type == ECONOMY )
{
newCar = new Economy;
Rental.AddVehicle ( newCar );
}
Come to think of it, I don't think I need to create an instance of NewCar. Something like this would be better, right?
if ( type == ECONOMY )
{
Economy* AddCar =...
Based on an instructor's suggestion, I'm going to parse the command file in main as opposed to the RentalSystem class. So at this point, what I'm trying to do is simply read in the car type from the...
Okay here's my dillema. I'm creating a class template, called RentalSystem. This RentalSystem is supposed to accept either a Car class or a Motorcycle class, with each having 3 derived classes for...
The compiler threw a warning at me for trying that.
RentalSystem.cpp: In member function `void
RentalSystem<T>::ReadCommands(std::vector<type, std::allocator<type> >&,
...
hk_mp5kpdw, my fault, they were warnings, not errors. I understand that the warning is telling me that it's trying to compare unsigned and signed ints. I tried declaring i as simply:
unsigned...
RentalSystem.cpp:357: warning: comparison between signed and unsigned integer expressions
I have a number of these errors in basically the same situation. Line 357 is :
for ( i = 0; i <...
Used something similar and it works great. Done my project 2 hours before the due date, and I didn't even procrasinate. What a mess =D. Thanks a bunch.
I was wondering how to use the fill function to place leading 0's before my integer value, provided it's not of a certain size. In the program I'm writing, I'm supposed to accept a membership card...
I'm having a problem with the following code:
NODEPTR curr, temp;
curr = (*headPtr);
while ( curr != NULL )
{
curr -> data = Dequeue ( headPtr, tailPtr );
temp =...
That's some seriously confusing code.
In your declaration, you wrote T stack1[SIZE]; T stack2[SIZE]; etc.
Wouldn't that be declaring it as a stack with array implementation? Because I can't...
I've created a program where I read in a certain amount of data from an input file, place it in a queue, and then I'm supposed to split the information between 4 different stacks. I've been provided...
You're absolutely right, I read it wrong :p
One last question. Should the following code work to determine the number of words in a string? I.e. I'm assuming all words are seperated by spaces.
for( i = 0; i < strLen; i++ )
{
...
That's working great. Now all I have to do is write functions to determine the number of vowels, characters, and words, as well as one to test if it's a palindrome or not. Then, I'll be all set =D
I did that. I'm not familiar with fflush, so I don't know what to expect but I didn't see any change.
Tried that. Didn't seem to have any effect.
So strArray has to be initialized in main?
Edit: It compiles cleanly, no warnings/errors.
I get the follow results when I run the program:
strArray[13] - A man, a plan, a cat, a canal: Panama?
Please select which string you'd like to analyze, or 0 to quit.
0
Segmentation fault...
Here's my main file
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "pal.h"
int main( int argc, char* argv[] )
Here's my pal.c file
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "pal.h"
/* Display greeting message */
I found I had a semicolon right after my for loop which was obviously a mistake, but that wasn't causing the seg fault. I have to think it's from that since it doesn't make it to my probe statement...
So I'm pulling out my hair here, as I can't figure this out. I'm getting a segmentation fault ( core dump) in my program and I don't understand why. It's a clean compile and when I run the program...
I'm sorry, I'm not trying to sound redundant. I'm just new to trying to work with an array of strings of a dynamic size. I can't seem to find an online resource, anything in my text book, etc. to...