kes166 37 Practically a Master Poster

what is the name when running ping -a <ipofhcserv01>? If it's something other than the computer name, the DNS may not be updated. Likewise, what happens when you ping the FQDN? It can be updated by running ipconfig /registerdns from hcserv01 and checking the event log for errors and try again.

kes166 37 Practically a Master Poster

It needs to be plugged into a tower. I wouldn't recommend opening a laptop either.

If you are unsure on how to plug the hard drive into a tower, you can probaby get it done for a hundred bucks at a tech store, best buy, or some other place and have the data placed on some other form of media. A Jump drive or a few DVD's.

If, however, the drive is shot, you're looking at a couple thousand bucks for a data recovery group to try and recover data from the drive. With a litte luck, hopefully it's only the seagate frame and not the drive itself.

kes166 37 Practically a Master Poster

I've never seen a seagate external drive, but ideally external drives should have screws that you can remove to take it apart. Inside will be the hard drive. It'll either be an IDE or a Sata hard drive. You'll need to plug it into your computer's power supply and mother board in order to read it.

Without actually being able to see what the inside drive looks like, I can't give much more information than that.

kes166 37 Practically a Master Poster

The first number will always be unique. Assign number to another value which should be your array, array[0] = number then the next random number you create, compare it to array[0]. If they are equal, make another random number until it doesn't equal array[0] then put it in array[1]. The third value you create you will need to compare to the first and second.

kes166 37 Practically a Master Poster

A jump drive or shared network drive. There are also websites that will allow you to accomplish this. Google Transfer Files.

kes166 37 Practically a Master Poster

In your main, you are assigning decimal values to an int value. Is that intentional?

line 13:

int next;

line 34:

while(in_stream >> next)

line 36:

Num[count]=next;

That's going to cause all of your data to be 1's. With that in mind, puting that information into the function line 58, sum will be 10, average will be 1 on line 61.


Line 66:

s =pow((Num[i]-average),2);

Since all values Num[0] through Num[9] is 1, that function is pow(1-1,2) which equals 0 which in turn sets sum = to 0.

so line 71 is outputting the square root of 0/10 which is 0.

kes166 37 Practically a Master Poster

If you still can't find the menu bar, go to the outlook folder and delete outcmd.dat. It's a file that has custom changes applied to the tool bars. It should be located in C:\Documents and Settings\<username>\Application Data\Microsoft\Outlook where <username> is your login name to the computer.

kes166 37 Practically a Master Poster

make sure it's not hidded or slid over. You can also bring up the view by going to view or Alt-V, toolbars then customize and make sure your menu bar is selected.

kes166 37 Practically a Master Poster

this should work

if (num%4 == 0)
 cout << endl;
kes166 37 Practically a Master Poster

Line 8 is breaking the assignment rules. You need to make the function

void minMax (int current, int& min, int& max);

get rid of x, y, and z.

void minMax (int current, int& min, int& max){

// make comparisons here.
// if current < min, then min = current.
// if current > max, then max = currnet.
}

Then from your main, read in a value from the file, and pass that to the function. You'll have to assign min and max to the first value you read in.

int main(){
//variable declarations
out.open("data.txt");
out>>a;
//initialize high and low to a
do {
minMax (a, high, low);
out>>a;
}while (out>>a)

That's basically what you're looking for. You should be able to fill in the blanks.

kes166 37 Practically a Master Poster

no there's no such condition that allows you move only oe or only two you can use both of them

If you reread the post, I account for all possible moves either taking 1 step or 2 steps. I did make one mistake in saying divide by 2, but you actually need to divide by k! to find the correct number of permutations where steps aren't reused. (n!/(n-k)!)/k!

In the 4 step example, the least amount of steps you can take is 2, for which there is only one viable solution: 2,4 add to legal struct.

you then find all solutions for taking 3 steps:
1, 2, 3 2, 3, 4
1, 2, 4
1, 3, 4

eliminate illegal moves and you are left with
1,2,4 2,3,4
1,3,4

add them to legal struct

Then all solutions for 4 stps
1,2,3,4

Eliminate illegal moves and you have
1,2,3,4

So you are left with
2,4
1,2,4
1,3,4
2,3,4
1,2,3,4

Only 5 possible solutions for a 4 step tower. It may actually be easier to just generate the entire (n!/(n-k)!) and eliminate redundant moves or back stepping in the elimination function.

kes166 37 Practically a Master Poster

It is correct ... if the steps are 1, 2, 3, 4 then 2 (taking 2 steps) then 4 (taking 2 steps) is a legal move.

1,3 is illegal because you don't end on 4.
3,4 is illegal because to get to step 3 is to many steps.

Anything that doesn't end on 4 is illegal.
If you have 5 steps, anything that doesn't end on 5 is illegal.
etc ....

kes166 37 Practically a Master Poster

yeah you just have to find how many different ways you can climb the ladder OK?
:yawn:

It's multi sets of the number of steps available. If there are 10 steps, the shortest distance you can get to the top is 5. If there's 11 steps, the shortest distance is 6 rounded up from 5.5. If there's 12, the shortest distance is also 6. Odd steps round up. You would then need to divide that number by 2, and it would give you the amount of possible solutions without repitition.

You'd then need to eliminate the illegal moves. Lets assume 4 steps, 1, 2, 3, 4 (excluding the 0 to make the math easier).
possible moves in 2 steps are:
1,2 2,3 3,4
1,3 2,4
1,4

Send that entire structure to a function to eliminate illegal moves and you are left with
2,4

All other moves are illegal, either taking more than 2 steps or not ending on 4 which are easy conditions to test for.

You then need to repeat the initial function which finds all possible moves, but in 3 steps instead of 4, then again to find all possible moves in 4 steps. Place all legal moves in a structure and throw out all the illegal moves.

kes166 37 Practically a Master Poster

how would you go about splitting it?

sorry im new im really trying to learn this

I'm going to quote the code right out of the post I linked and modify it slighly.

int length=strlen(sentence);
 int check=0;    
 for(int i=length-1; i>=0; i--){
        if(sentence[i]!=' ' && i != 0){
            check++;        
        }
        else{
            for(int j=i; j<(check+i); j++)
                cout<<sentence[j+1];
                cout<<" ";
                check=0;        
        }
 }

sentence = junk#crap

You will still need to modify this code, but once you understand it, it'll be easy to see. This code cout's where you would actually need to save the values elsewhere instead of just displaying them.

kes166 37 Practically a Master Poster

you could cheat and return

return ((pow(x,2)+x)/2);
kes166 37 Practically a Master Poster

An if statement.

If string[n] == '#' then split the string.

Also, take a look at this code that someone else wrote. If you can understand it, you can adapt it.

kes166 37 Practically a Master Poster

It doesn't sound like a virus. Try updating with the current driver for your graphics card. Check the website of the graphics card, or google your graphics card and you should get their website.

I would also open your computer, and check the fan on the graphics card if it has one. If the fan doesn't work on the graphics card, you'll need a new one. If the above doesn't fix your problem, you will probably need a new one also.

If the problem is with your graphics card, the longer you try to run with it, the greater the chances are that you will ruin the motherboard.

kes166 37 Practically a Master Poster

try initializing your variables. in your function void timeCalc, if line 70 executes, days will equal a garbage value.

days goes to printTime as nDays and you immedietly start using it in comparisons on line 80.

kes166 37 Practically a Master Poster

When you create the new person from your Op post

tempPer = new Person[stuNum];

Using your example, you create 3 objects: 0, 1, 2. In your for loops

for(j = 1; j < stuNum; j++)
          tempPer[darrPer[j].age] = tempPer[darrPer[j].age] + 1;
 for(i = 1; i < k; i++)
          tempPer[i] = tempPer[i] + tempPer[i-1];
 for(j = stuNum; j > 0; j--)    {
          sortPerAge[tempPer[darrPer[j].age]] = darrPer[j].age;
          tempPer[darrPer[j].age] = tempPer[darrPer[j].age] - 1;
 }

You never reference tempPer[0]. I'm not sure if the for loops are doing exactly what you want, so I will try to break down what each loop is doing.

for(j = 1; j < stuNum; j++)
   tempPer[darrPer[j].age] = tempPer[darrPer[j].age] + 1;

[darrPer[j].age] is going to be darrPer[1].age which in your examples case will be 25, Jills age, which makes tempPer[25] = tempPer[25] + 1. I'm not sure what that does, and I'm surprised that line doesn't give an error or a warning. The second iteration, it will reference tempPer[27]. Basically, this for loop does nothing with memory that is in bounds.

for(i = 1; i < k; i++)
   tempPer[i] = tempPer[i] + tempPer[i-1];

this will set tempPer[1] = tempPer[1] + tempPer[0] in the first pass
then tempPer[2] = tempPer[2]+tempPer[1]
...
finally tempPer[89] = tempPer[89] + tempPer[88]

Again, I'm not sure what you are trying to accomplish here.

In the last loop

for(j = stuNum; j > 0; j--)    {
          sortPerAge[tempPer[darrPer[j].age]] = darrPer[j].age;
          tempPer[darrPer[j].age] = tempPer[darrPer[j].age] - 1;
              }

in the first …

kes166 37 Practically a Master Poster

What OS?


Edit: Vista or 07

In the lower right corner, you should see an icon that looks like a speaker. If you don't, there should be an arrow that will expand the icons that are in the lower right corner near your clock time. Click the expand arrow, then RIGHT CLICK the speaker.

Left click sounds

You should see a dialog box that is titles "Sound" with three tabs: Playback, Recording, Sounds.

Left click Playback.

Make sure that your headphones are located there. Highlight the headphones by left clicking them, and then click the button "Set Default". That should get the sound to go out your headphones.

kes166 37 Practically a Master Poster

I'm not sure if I'm understanding the problem fully, but it looks like you are trying to give the same template two names?

You could try making a second template with the second name you want, and add

friend class QuantitativeStats<T>;

That should allow you to create a QuantitativeStats class that uses all the required variables.

I also found a similar problem where someone suggested wrapping the typedef in a structure.

template <typename T> struct QuantitaveStats
{
    typedef NumericalStats<T> type;
}

Then invoked by

QuantitativeStats<t>::type myStat;

Anyways, I'll admit this is outside my knowledge, but thought I'd fish around for an answer.

Edit: firstPerson beat me to it. Guess I surfed around to long :)

kes166 37 Practically a Master Poster

line 23, set counter to 0.
line 32, your if statement is syntatically incorrect. you need ==. Also, you don't need that if statement.
Line 33, sumEvens = number + number? Think about that for a sec. If the number happens to be 2, sumEvens will be 4. The next iteration, number is 16. sumEvens will be 32. 16+2 != 32. You need to include the variable sumEvens in the addition.
line 38, you will never have a case of -1, you can erase that line.
line 37 once you get rid of 38, it will flow correctly.
line 40 your if statement is again wrong and why even have it?
line 41 same problem as line 33.

codingNewB commented: very clear and understandable instructions +0
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

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

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
#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
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

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

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

The way someFunction() is declared should be okay because it is a member function. As a member function, it has access to the private members of both objects. Something like this would be fine:

void SomeObject::someFunction(SomeObject & other)
{
  if ((this->b) > (other.b))
    cout << "This b is greater than other b" << endl;
  else
    cout << "Other b is greater than this b" << endl;
}

int main()
{		
  SomeObject s1(1,2), s2(3,4);
  s1.someFunction(s2);

return 0;
}

@OP:
NOTE, this code is very similar to yours, but it will not work within your program as written. IT IS ONLY AN EXAMPLE.

Would something like this work to return the two values?

:

void SomeObject::someFunction(SomeObject & other, int *firstb, int *secondb)
{
  if ((this->b) > (other.b))
    cout << "This b is greater than other b" << endl;
  else
    cout << "Other b is greater than this b" << endl;
  *firstb = this ->b;
  *secondb = other.b;
}

int main()
{		
  int *valueA, *valueB;
  SomeObject s1(1,2), s2(3,4);
  s1.someFunction(s2, valueA, valueB);

return 0;
}

I'm not sure if the syntax is correct, but I know I've used the concept of passing pointers back to main before. valueA should point to the value in s1.b and valueB should point to s2.b

kes166 37 Practically a Master Poster

Edited because I was wrong:
You can call someFunction by s1.someFunction(s2) and have it return whichever value you want, but you will still need to make it a void function if you want both values returned. It would be easier to make a seperate function to access s1's b vaule.

Depending on what you want the function to do, return the highest, lowest, or whatever, you'd just return whichever one you wanted. If you wanted to return both, you would need to use pointers in the function and make it void.

You also need a constructor as already stated.

bmos31 commented: s1.someFunction(s2) is exactly what I was looking for..Thanks! +1
kes166 37 Practically a Master Poster

I may be missing something here given the antihistamine I took an hour ago, but since I've never hesitated to sound foolish in the past I shan't be bashful at this point either.

What size is a list and how would the compiler know how much memory to sequester for an array of lists? List objects should have their own addresses (distinct from the address of the frist node of the list, etc) so an array of pointers to lists seems more intellectually satisfying as I'm thinking about it, though I admit to never having written such a structrue to know whether an array of lists works or not. (Could the name of a user defined object degenerate to the address of the object similar to the name of an array degenerating to the address of the first element of the array eventhough that doesn't happen for the names of native data types?)

That's basically what it is, an array of pointers. But studentTable[0] will always point to the first node in the list. To navigate that, or any of the other 9 lists in the array, you would have to create a temp node and go through all the next pointers.

The space needed is on a by node basis. As a new node is needed, the space is created.

studentTable[0] points to the first node in it's list so studentTable[0].data will reference that specific node.
studentTable[1] points to the first node in it's list so …

kes166 37 Practically a Master Poster

The value is returned to the location where the function call came from

total(num1,num2);

However, you didn't assign it to a variable. The return statement returns the value sum to the function call.

You can do it two ways, either set the returned value to a variable declared in the block of code where you used it, or print the value directly.

foo = total(num1,num2); //foo holds sum

or

cout << "The value is: " << total(num1, num2);

Either way should work.

JDean89 commented: Thanks alot +0
kes166 37 Practically a Master Poster

Yes, you can make an array of any defined data type, whether built-in or user-defined. But you can't create, for example, and array of integers and store more than one integer in an element, if you attempt to do so, you'll simply overwrite the element with the new integer value. Hence the reason I said it's not directly possible.

Did you even read the rest of the post?

Like I said, I didn't really understand what he's looking for.

After rereading it, it kind of sounds like he's looking for an array of linked lists. I'm not 100% sure on syntax and I have no compiler to test it, so I won't bother trying to write it as I would probably just butcher it.

kes166 37 Practically a Master Poster

Your intent is a little confusing, it sounds like you want to add multiple items to the same element of an array. Which is not directly possible.

Actually, I think if you create a structure, and then create an array of that structure, you can do what the op is suggesting. It's not a linked list though.

struct foo{
int myFirstData;
int mySecondData;
};

int main(){
foo myArray[10];
myArray[0].myFirstData = 1;
myArray[0].mySecondData = 2;
}

Although, I'm not 100% sure of what the Op is asking.

Edit:

I think you can make an array of classes also.

kes166 37 Practically a Master Poster

yes, i need to declare a new student and add it to the list.
heres what i have so far, but i get an error.

void add(string student, string university, int id)
       {
           //create a new node
           node * somenode;
           somenode = new node;
           
           //put student in the new node!
           somenode->data = (student, university, id)
          
              
           
           //put new node at front of list!
           somenode->next = start;
           start = somenode;
       }

no no ... you need to break that up ...

somenode->data = student;
somenode->university = university;
somenode->id = id;

Edit:

I also recommend you don't use university or id in the function call. I usually found it to be bad programming practice to use class variables and function variables confusing if they were using the same name.

kes166 37 Practically a Master Poster

One other thing I noticed is in your class studentnode

class studentnode{
public:
       string data;
       studentnode * next;
 	   // string to hold student name
       string student; };

You don't use student to hold the students name. You use data. You can remove string student; from the program, and it should still function.

kes166 37 Practically a Master Poster

i think i see where your going with this.
i have everything in one file. im using devc++ so i dont think i can make a .h file.
here is my entire code as i have it so far:

#include <iostream>
#include <string>


using namespace std;


//new class for studentnode
class studentnode
{
public:
       string data;
       studentnode * next;  
	   

	   // string to hold student name
	   string student;

};


//new class for studentlist
class studentlist
{
private:      
      studentnode * start;
      
      
public:
       studentlist()
       {
           start = NULL;            
       }
       
   
       
       // function to add a new student to list
       void add(string student)
       {
           //create a new node
           studentnode * somenode;
           somenode = new studentnode;
           
           //put student in the new node!
           somenode->data = student;     
           
           //put new node at front of list!
           somenode->next = start;
           start = somenode;
       }
       

       //function to a specified student, if not traverse the list until found.
void getStudent (string student)
{ 
     studentnode* current;
     current = start; 
     while(current!=NULL)
     {   
         if(current->data == student)   
         {    
               cout << "The Specified Student Has Been Found: "<< endl;
               cout << student <<endl;  
                 break;  
                 }  
                  current = current->next;  
                  }
                  }

       

       //display all the items in the list
       void print()
       {
            studentnode * current;
            current = start;
            
           //loop through all nodes, each time doing something
           while(current != NULL )
           {
               //display the data of the current node
               cout << current->data << endl;
               
               //move current to next node
               current = current->next;               
           }     
       }
};







//main program thats ran.
int main()
{
    cout <<"This linked list should display students …