kes166 37 Practically a Master Poster

What are you using to rip the DVD?

kes166 37 Practically a Master Poster

Why are you trying to execute those commands in a class definition and not in a function, or in main itself? You also did not declare an object of PasswordSystem.

What is

PasswordSystem.Shazam();

???

You have no static function called Shazam to execute.

kes166 37 Practically a Master Poster

>>1. the number of strictly positive values read (those greater than zero)
>>2. the number of strictly negative values read (those less than zero)

Your code is correct for the above.

>> 3. the total number and arithmetic mean (average) of values read
Use two variables. The fist will be the total sum of the values that you read in. The second will be the total number of values you read in. Once you have those two values, divide and get the average.

sum += sum + num; //where num is the value that is read in
counter ++; //counter starts at 0, then increments by one every time a number is added to sum.

>>4. the largest and smallest values read
This is pretty easy. Make two variables, largest and smallest. If num < smallest, then num is your new smallest. If num > largest, then num is your new largest.

>>5. percentages of the number of strictly negative values and strictly positive values read

You will need the total number of values read in (counter variable should suffice) and the total number of positive and the total number of negative values. You can use seperate counters for each.

kes166 37 Practically a Master Poster

You will need to use a hash table for spelling and grammar. You would need something similar to microsoft word spelling checker and autocomplete function. Sorry, but this is a bit to advanced for me to even begin to understand where to start as far as spelling is concerned.

Iterations of words can be checked easily though.

If word x = word x + 1, then it's an iteration of the same word. The only issue I could see with that is if the iteration is grammatically correct, such as "I told him that that isn't right". That is the only exception I can think of.

kes166 37 Practically a Master Poster

I'm assuming you are looking for an algorithm?

Are the word insertions and deletions prompted for and controlled by the user? If the editing is controlled by the user, it's pretty easy. You just need to read the string in from the cin, seperate the word being inserted/deleted from the int value which looks to be the location of the word in the sentence, then modify the master string by searching through the white space, finding the appropriate word, then adding or removing it.

kes166 37 Practically a Master Poster

Basically, arrays need to be declared with a known size prior to execution. You were trying to declare a fixed array even though it had a variable size. If you don't know the size of the array, you need to create the space for it dynamically which is what

int *array = new int[size];

does.

Since there is no way to to know the size needed of the array, you have to either make it large enough so the array won't go out of bounds or declare the array dynamically. Whenever you need to declare an array of size n, you need to declare it dynamically.

I think some compilers allow you to write code where if you use a variable it will declare it dynamically, but if you get an error from trying to declare an array with a varaible size, it's most likly trying to declare a fixed array as a dynamic array.

kes166 37 Practically a Master Poster

01001001 00100000 01110100 01101000 01101001 01101110 01101011 00100000 01110100 01101000 01100001 01110100 00100000 01110100 01101000 01101001 01110011 00100000 01100111 01101001 01110110 01100101 01110011 00100000 01100001 00100000 01110111 01101000 01101111 01101100 01100101 00100000 01101110 01100101 01110111 00100000 01101101 01100101 01100001 01101110 01101001 01101110 01100111 00100000 01110100 01101111 00100000 00100010 01010111 01100001 01101100 01101100 00100000 01101111 01100110 00100000 01010100 01100101 01111000 01110100 00100010 00101110 00100000 00100000 01001001 00100000 01100011 01100001 01101110 00100000 01101110 01101111 01110111 00100000 01110100 01111001 01110000 01100101 00100000 01110100 01110111 01101111 00100000 01101111 01110010 00100000 01110100 01101000 01110010 01100101 01100101 00100000 01110011 01100101 01101110 01110100 01100101 01101110 01100011 01100101 01110011 00101100 00100000 01100001 01101110 01100100 00100000 01110100 01101000 01100101 00100000 00110000 00100111 01110011 00100000 01100001 01101110 01100100 00100000 01110100 01101000 01100101 00100000 00110001 00100111 01110011 00100000 01110111 01101001 01101100 01101100 00100000 01101010 01110101 01110011 01110100 00100000 01100111 01101111 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 01101111 01101110 00100000 01100001 01101110 01100100 00100000 00101110 00101110 00101110 00100000 01001001 00100000 01110100 01101000 01101001 01101110 01101011 00100000 01111001 01101111 01110101 00100000 01100111 01100101 01110100 00100000 01110100 01101000 01100101 00100000 01101001 01100100 01100101 01100001 00100000 00101110 00101110 00101110 00100000 00111010 00101001

kes166 37 Practically a Master Poster

is degree declared elsewhere? Also, you aren't assinging the static cast anywhere. x is still int, and degree is still whatever it is wherever you declared it. You would need

double value = static_cast<double>(x);
double deg = static_cast<double>(degree);
kes166 37 Practically a Master Poster

for your insertion and bubble sort, you are returning the comparison value, but you are not assinging it to anything when that value is returned. In your main

insertionSort(copy_integers_1);

Change that to:

int compInsertion = 0;
...
compInsertion = insertionSort(copy_integers_1);

and do the same with your bubble sort.

It actually would work the way it is, but the second time you call your functions (in your cout statements in main) the arrays are already sorted.

As for your error, try this

int *L = new int[Left_Size];
int *R = new int[Right_Size];

Also, you probably don't need to declare Left_Size or Right_Size as const.

kes166 37 Practically a Master Poster

1. Provide a default constructor that assigns 0 to the yearModel and mpg, and the empty string to the make.

gerard did the yearModel and mpg in his post. All you need to add into that is

make = "";
kes166 37 Practically a Master Poster

If you have one, try using a monitor with a VGA connector right after the monitor crashes, but you can still hear the PC sounds in the background. It sounds like the monitor or the video card. Try onboard video if you have it with a different monitor.

It doesn't sound like the PC is that old, isn't it still under warrenty?

kes166 37 Practically a Master Poster

Look at the motherboard for capacitors that are round on top. There are web sites that advertise they will replace capacitors (the names elude me currently) but it's expensive, and you're better off buying a new motherboard if that is the case.

kes166 37 Practically a Master Poster

Don't you mean Car *a = new Car()...

Yes, thanks

kes166 37 Practically a Master Poster
class Car {
       private:
               int yearModel;
               string make;
               int mpg;
      public:
               Car(int, string,int);       //constructor #1
               Car(int, int, string);      //another constructor #2 
               Car(string, int, int);      //another constructor #3
               Car();         // def constructor prototype #4
};

ALL constructors take on the name of the class. You can have 20 constructors for a single class if you want as long as the paramters used in calling it are different. Based off the parameters, it will determine which one to use.

A constructor with NO parameters is the default constructor. So for instance

Car *a = new Car(1, "Bob", 10); //uses #1
Car *b = new Car(1, 10, "Bob"); //uses #2 
Car *c = new Car("Bob", 1, 10); //uses #3
Car *d = new Car(); //uses #4 and calls the default constructor

Hope this helps.

kes166 37 Practically a Master Poster

Three possible things that could be wrong that I can think of. The first, and easiest, is your keyboard isn't plugged in. That shouldn't stop the computer from continuing on past post however, which leads me to think there may be another problem. Try switching to a different keyboard. Your boot sequence might also be messed up in your BIOS. Your harddrive may also have a bad install of an OS on it or crashed.

I would say out of the three of those, the most obvious culprit is a bad keyboard.

kes166 37 Practically a Master Poster

Looks like you did all your work in main. What exactly do you want void add_formula (ff *p1) to do? I posted a workable add_formula function above for the class that will allow the user to enter the id for each person.

kes166 37 Practically a Master Poster

It looks like you want each node to point to the two below it, and the one above it.

In your code, you have

f = new formula;		
f->id = 1;		
f->op = 0;		
f->oe = 0;

This is a syntax error. You need to declare f as a struct ff, then you need to declare it as a new ff like so

ff f;
f = new ff;
// or
ff f = new ff;

Once you have done that, you can then assign id a value. What I'm not sure of is, what is f->op and f->oe? is there a formula class not listed but declared?

If you want the user to enter data, then call the function and cin that info.

void add_formula(ff *p1){
int data;
cout <<"Enter Data: ";
cin >> data;
p1->id = data;
}
kes166 37 Practically a Master Poster

Make an attempt, and we'll trouble shoot your code. We aren't going to write it for you.

kes166 37 Practically a Master Poster

Look at the motherboard, check the capacitors. If the tops of them are bubbled up or there's something leaking from them, the motherboard is bad. Also, try removing your video card, and running with on board video.

Also, current PC's may need 350 watt powersupply. Check the model of your PC on the dell website to determine the best power supply.

kes166 37 Practically a Master Poster
#include <iostream>
#include <string>
using namespace std;


string myfunc(string s){
{
	if (s.compare("banana") == 0)
	{
	     return "Good String";
	}
	return "Bad String";
}

int main (int argc, char* argv[]){
string s = "oranges"
string a = ""
a = myfunc(s);
cout << a;
}

The compare returns a non 0 if the case doesn't match as well. In order to compare two strings and ignore upper/lower case you need the toupper or tolower function.

Edit:
What the poster above me said as well. I thought the == was overloaded to work as compare in c++.

kes166 37 Practically a Master Poster

Sounds kind of random. Are you on electric power or battery power? Make sure your coord didn't come unplugged, and the battery was low. I've done that in the past numerous times, especially if you use a surge protector connected through your power coord.

The only time I've seen a PC die with no beeps or responsiveness on start up was when the motherboard was shot.

kes166 37 Practically a Master Poster

If it doesn't compile, my suggestion is to use the same compiler that your teacher is going to use. If your teacher uses turbo c++, then you are better off using that. It's possible to write a program that will compile on your PC, then have your teacher try to run it, and it errors out due to the differences in compilers.

kes166 37 Practically a Master Poster

You don't need one, it auto initializes everything.

Your functions are messed up though. In your class you have

double getRadius();
 double CalculateArea();
 double CalculateCircumference();

You need a return statement in each one of those. Also, you need to assign what is returned to a variable. I think if it errors or gives a warning is dependant on what compiler you use. In your main, you don't assign the returned value to anything. change CaluclateArea and CalculateCircumference to voids.

I also think you need

myCircle = new Circle;

in your main.

Do you get any errors when you compile or run?

Edit:
I don't think you wrote your setRadius function either in your main Op.

kes166 37 Practically a Master Poster

In your struct Doctor, you have a declaration

sting Do;

I'm pretty sure you can't do that. Do is a reserved word.

As for your add_student function, I'm assuming you want to add the students onto your doctors, and each doctor will be the start of a linked list. It looks like you are actually creating and adding the students in the allocate function.

void allocate( Doctor_Un * ptr_t){
     Doctor * Doct;
     student *st1, *st2;
     Doct = new Doctor;

     Doct->name = "A";
     add_student(Doct, st1); //this will add st1 onto the Doct struct.
/*   st1 = new student;
     st1->next = NULL;
     st1->St = "Student_1"; */
     st2 = new student;
     add_student(Doct, st2); //This will add st2 onto the end of st1
/*   st2->next = st1;        
     st2->St = "Student_2"; */
     ptr_t->add_tasks(Doct);

The add_student should take in the student along with the doctor you want that student to be given to.

Doct->name = "B";
     st1 = new student;
     st1->next = NULL;
     st1->St = "Student_3";
     Doct->Stu = st1;
     ptr_t->add_tasks(Doct);

     Doct->name = "C";
     st1 = new student;
     st1->next = NULL;
     st1->St = "Student_4";
     Doct->Stu = st1; 
     ptr_t->add_tasks(Doct);
     cout << "************************************************************************** \n"; 
     ptr_t->gener_tasks();
}

This part, I'm not entirly sure it will work the way you think it will. Doct is still pointing to the original memory location, so it's going to change Doct A to Doct B ie, it will overwrite your first doctor. My suggestion would be instead of trying to create 3 doctors and multiple students in one function, try …

kes166 37 Practically a Master Poster

Put your code in code tags ....

for ( int e = 0; input[e] > avg; e++)
    count++;

Like that ... it's easier to read. Also, that for loop is your problem.

Assume your input is 2 numbers: 0, 100 ... your average will be 50.00
input[0] = 0
avg = 50.00
The first comparison is input[0] > avg.

Your for loop comparison is:

for (int e = 0; 0 > 50; e++){
    // etc
}

You need to fix the logic in the for loop.

kes166 37 Practically a Master Poster

"A starved man wanders into the depths of a foreboding wilderness in the dark of the night with a shotgun. The only light is that which shines from the full moon casting shadows on the forest floor. Just as the young man crosses an opening in the foliage he sees a rabbit. The young man hasn't eaten for days. He raises the barrel to shoot at the rabbit but before he does the rabbit speaks...

'If you shoot me you will die. If you do not shoot your family will die.'"


What does the man do?

Those who really wish to know the answer can PM me.

Happy thinking :)

Let's take this apart a bit.

What do we know?
Fact:

  • The man is hungry hasn't eaten in three days
  • The man is in the woods wandering
  • it's dark and only the moon to see by
  • The man is in a small foliage opening when he sees the rabbit
  • The man is hunting with a shotgun
  • it's a talking rabbit! If the man shoot the rabit, he dies, else his family dies.

Now, what are some assumptions we can take from this?

Assumptions:

  • it's dark therfore he can't see far
  • he can't see far, therfore in order to see the rabbit, he is close
  • he is hunting with a SHOTGUN! Have you ever shot a small animal point blank with a shotgun? There will be nothing left of the animal
  • if …
kes166 37 Practically a Master Poster

Generally, E is a failing grade, its value is 69. What if you used E as a baseline for your QP? You would then subtract the earned grade from this "baseline" to generate a QP value:

char letterGrade = '\0';
cout << "Enter letter grade: ";
cin >> letterGrade;
qp = 'E' - letterGrade;

oooo clever ... :)

I didn't even think of that one.

kes166 37 Practically a Master Poster

I'm not seeing how that is going to do what I need. qA through qD is each grade? Corresponding to the text file, qA = 4, qB = 3, qC = 2, and qD = 3?

qD will be 1, not 3.

the static_cast<int>('A') is the letter grade. You can replace the ('A') with whatever char variable you assigned the grade letter A to.

kes166 37 Practically a Master Poster

This should work

int k = 0;
int qA = static_cast<int>('A') - (61 + k);
k+=2;
int qB = static_cast<int>('B') - (61 + k);
k+=2;
int qC = static_cast<int>('C') - (61 + k);
k+=2;
int qD = static_cast<int>('D') - (61 + k);
kes166 37 Practically a Master Poster

Here's psuedo code.

cast A to int qa
cast B to int qb
cast C to int qc
cast D to int qd
qa = qa - (61 + 0)
qb = qb - (61 + 2)
qc = qc - (61 + 4)
qd = qd - (61 + 6)
kes166 37 Practically a Master Poster

65 - (61 + 0) = 4
66 - (61 + 2) = 3
67 - (61 + 4) = 2
68 - (61 + 6) = 1

kes166 37 Practically a Master Poster
for(i=0;i<a; i++){
        flag=false;
        for(j=0;j<b; j++){
            if(cosc208[i]==CTECstudents[j]){
                flag=true;
            }
            if (flag=true){ //this needs to be ==
                Intersection[k]=cosc208[i];
                cout<<Intersection[k]<<" ";
                k++;
            }
        }
    }

Your equals are messed up again.

When you are assigning a value to a variable, you use =
When you are doing a comparrison in an if statement, you use ==
in the above if statement, everytime that line is executed, flag is set to true, and that if statement will run every time.

Look at the first iterration of your loops.
a = 5 and b = 5 .. That won't change
i = 0, flag = false
j = 0, k = 0
It then asks if cosc208[0] = CTECstudents[0], it doesn't so it skips down.
It then sets flag = true
It then sets Intersection[0] = cosc208[0] = 11
k now equals 1 and the inner loop continues

j = 1
It then asks if cosc208[0] = CTECstudents[1], it doesn't so it skips down.
It then sets flag = true (note, it's already true, there's a logical error here)
It then sets Intersection[1] = cosc208[0] = 11
k now equals 2 and the inner loop continues.

etc etc

You need to fix your if statement, and reinitialize your flag for every interation of the inner loop, or better yet, get rid of the flag completly and change your if statement from

if (flag=true){ //this needs …
kes166 37 Practically a Master Poster

Before i changed int Intersection[a]={0}

i got:
Please enter the amount of students taking COSC 208
5
Please enter the ID's for all the students who are taking COSC 208 and press ent
er
11
12
13
2
22
Please enter the amount of studnts whose major is CTEC.
5
Please enter the ID's for all the students with CTEC as thier major.
11
12
13
2
22
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Press any key to continue . . .

after i changed it....it would compile and i got the following results

21 C:\Users\Fawaz\Documents\COSC 113\PA1.cpp variable-sized object `Intersection' may not be initialized


i think the problem is the sum
it keeps going back to zero for some reason.

Yeah, the string of zeros came from not having assigned flag to anything. make it one = instead of two, and see what you get.

kes166 37 Practically a Master Poster
for(int i=0;i<a; i++){
  flag==false;
  for(int j=0;j<b; j++){
    if(cosc208[i]==CTECstudents[j])  //<---comparison never executes
      flag==true;
    if (flag==true){
      Intersection[k]=cosc208[i];  
      sum=++k;;
    }
    cout<<sum<<endl;
  }
}

Few things I've noticed. flag == false; should be flag = false; and flag == true; should be flag = true;

also, sum=++k;; should be sum=++k;

I'm not seeing anything else.

kes166 37 Practically a Master Poster

Hey,

First thing I noticed is that sum isn't initialized. It's possible to go through your nested for loops and for it to find no comparison. It will then cout an uninitialized variable on line 43.

For that mater, I don't think you initialized k either.

Set k = 0 and Sum = 0 and see if that helps.

One other thing I noticed ...

sum=k++;

Line 41, I believe (once k is initialized) sum will be set to 0 the first iteration of the loop, and k will be incremented. If you want sum to be equal to 1 on the first iteration you will need

sum = ++k;

Edit:

What Fbody said :)

kes166 37 Practically a Master Poster

Hi,

Put your code in code tags, it helps when reading.

The answer is staring you in the face.

fullWord = oneWord + ", " + twoWord + ", " + threeWord + ", " + fourWord + ", " + fiveWord;

Change the order of that to get your answer.

kes166 37 Practically a Master Poster

In this case, let's just put aside the non-standard code presented by the OP plus the seemingly 'impossible' basic requirements. It's quite obvious that the "void main()" etc. is not the key topic here, at least from the OP's viewpoint.

Again, like I wrote above, a simple #define solves this 'problem' in 100% standard and portable C++ code. As far as I can see, the only good outcome of this exercise for the OP would be to realize the possible dangers of using macros (e.g. using #defines carelessly).


@OP
It would actually be nice to know how come you are facing this dilemma, would you care to share that with us?

Ok ... I'll admit, I'm lost. I used #defines to declare token strings. I'm not seeing how that will do anything?

kes166 37 Practically a Master Poster
void function(int arg){
	char chars[10];
	/*	some statments	*/
} 

void main(){
	int arg=0;
	function(5050);
	arg++;
	cout<<arg;
}

SOME compilers allow void main. However, it is terrible programming practice to do so. When a program runs and completes, after the program completes, it sends a value to signify that it terminated successfully or unsuccessfully. If it is a void main, the value is random, generally a garbage value. If that value is outside a certain range, the program fails.

If you use int main, the program can return the appropriate value. You are taking an unneseccary risk in using void main.

Additionally, you have int arg in your main. This variable IS NOT the same variable as the one in your function. When you declare a variable, it assigns it appropriate memory space.

int arg = 0;

That assigns arg as an int value (I think 8 bytes).

void function(int arg){
	...
} 

void main(){
      ...
     function (5050);
      ...
}

That passes 5050 to a completly new memory location outside the function main and assigns it to a new variable called arg. arg in the function has no relation to the arg in main. The arg in main is beyond the scope of the function function to change. When your program terminates, arg in main will increment by 1, and have the value of 1. There is nothing you can do (to my knowledge) that will let you change arg in main by modifying code …

kes166 37 Practically a Master Poster

*deleted*

Sorry, must have hit submit before completing actualy post which is below.

kes166 37 Practically a Master Poster
ifstream in;    // Create an input file stream.
in.open("data.txt");

that will open data.txt as read only. If you want to protect the file from being written over, I suggest you modify the properties of the file, or (if using windows) go to a command prompt, go to the folder with the file in it, and type

attrib +r filename

which will set the file itself to read only.

kes166 37 Practically a Master Poster

Going through how to optimize code would take months to explain. Linear code is linear code. Both statements take x amount of time. Avoid many nested loops. If you have code, it would be easier to explain where your coding might be inefficient.

Edit:

If you just want to know why, I would think it's because the first line is assigning a value to a variable where the CPU has to look up the value in *ptr where the second line, you are just assigning a value directly to the variable and no other work is needed.

kes166 37 Practically a Master Poster

i wanted to use the strcmp command, but the assignment addresses us not to do so.
is there another way to do that or do i have to go and specify something like

//would i have to do this with every possible way of debug if i dont use the strcmp command?

 else if (command == "debug" || command == 'Debug' || command == 'DEBUG')   
   {
         cout << "will allow you to execute in debug mode\n";  
    }

Do what FBody suggested, and use the toupper() or tolower(), loop through the command and make all the characters in the string upper or lower case, then you can compare command to the lowercase (or uppercase) version of the word.

int main (int argc, char *argv[]){
    string command = "DeBuG";
    int i = 0;
    while (i < command.length){
        command[i] = tolower(command[i]);
        i++;
    }
    cout << command;

The output should be debug

kes166 37 Practically a Master Poster
else if (command != "load filename" || "execute" || "debug")

You need a comparison after each ||.

You could also just get rid of that last if statement completely.

The only thing I'm unsure of is the case comparison. If someone enters Debug instead of debug, I don't think the debug portion of your if statement will catch it.

I think if you use strcmp(string1, string2) it will work out better but I'm not 100% sure.

kes166 37 Practically a Master Poster

The level of involvement related to analyzing the inputs is about the same. The only real difference is whether you or the OS has to handle the input functionality.

I think what you said and what I meant are the same. By easy I was refering to

int main (int argc, char *argv[])

it's already done for you, argv is the array of strings, and argc is the number of words

Where as the other way you'd need a deliminator to seperate the words, usually a space, put each word into an array of strings, and get the length of the array.

The first way just needs error catching. The second way needs to be formated into what you want it, and then error catching.

kes166 37 Practically a Master Poster

Are you attempting to do this from a command line or running the program and then picking apart the input from there? Running from a command line is easy. Picking a string apart inputed after the program is ran is also easy, but a bit more involved I think.

kes166 37 Practically a Master Poster

Hi there!

My name is Ken, and I'm an old (not age) C++ programmer. I went to school for it, and it's been about 7 years since I've actually programmed anything hard, so I figured a forum would be a great place to relearn alot of it by teaching what I remembered, and lurking to remember what I forgot.

I'm 34 years old and currently unemployed because of being laid off from a work force reduction in my last job, and I'm attending school for an A+ and Network+ certifications from CompTIA to learn some new tricks and trades.

If anyone is hiring a 7 year removed C++ programmer I'd be happy to fill the position. :)

kes166 37 Practically a Master Poster

RajKumar ---> Who?

kes166 37 Practically a Master Poster

This is a fun little thread I happened on, so I'll throw in my 2 cents ...

*Puts on tin foil hat*

You decide if this is true or not ... It's something that I heard on coast to coast, and found it on a web site.

Coast to Coast caller

Video made before the BP spill

kes166 37 Practically a Master Poster

Create a structure to hold all the information and a linked list to contain the structures of each individual.

You may need to create 5 special functions in the class that returns the number of people under 20 (1), 20-29 (2), 30-39 (3), 40-49 (4), 50 and older (5).

Step 1: Input individual one at a time & enter them into a structure.
Step 2: Repeat step 1 for as many people
Step 3: Seperate them by age group. You can either use an int age and seperate them out every time there's a query for a specific age group, or you can create an array of linked lists and put them in a specified linked list based on their age and make an int size to keep a reference of the size of each individual linked list.

kes166 37 Practically a Master Poster

A few things here .... First, wrap your code in code tags. It makes it easier to read.

Secondly, what kind of error are you getting?

Thirdly, I noticed that your while loop runs until temp != Null but two lines down from that you try to reference temp->next->word. If temp is the last item in the list, you are trying to reference data on a node that doesn't exist. temp->next = null but you are trying to get temp->next->word.

finally, you aren't actually sorting nodes in the function. You are just moving string values around the variables a, b, and c. It's not doing anything.

Ancient Dragon commented: good answers :) +33