Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 37: delete the brackets [] after array. You don't normally use those in a parameter unless you put a number inside.

line 53: i is an integer, array is a pointer -- you can't compare them. i < array is wrong.

line 65:If you want to display the array values you have to do it one element at a time in a loop.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

suggestion

int main()
{
   // put your code here

   return 0;
}

Ok, so lets assume you know how to do the above. You need a for/next loop that counts from 0 to 5, display a prompt, get input using cin, then keep track of the highest number entered (you need another variable to do that).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Favorite epesode: House of Quark -- especially the scene where his wife Grilka (Klingon) divorced him :) :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Naw -- Janeway was only ok. I liked the overall story line, but tv station in my area pushed the timeslot back so far that it was too late for me to watch it. So I didn't get to see the last couple seasons.

My favorite critter (or race) was the Ferengi on DS9. I thought many of the characters on ST was even more interesting then any of the captains.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've never been much of a hearts player though.

Its a lot more fun (and more difficult) when played with real people. But that's true of any game.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Never worked on web programming -- don't know the first thing about it either. All my experience is with desktop and wireless (barcode scanners) devices and interfacing with other equipment you might find on assembly lines in manufacturing plants. Probably the most interesting one was writing a program for a toothbrush manufacturer in Tennessee, that interfaced PC, database, vt100 terminals, and lazer printer that etched text on the sides of toothbrushes. Over the 12 years I worked for that company I got to visit quite a few manufacturing plants of all sorts.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

how about this? this->textBox2->Text = "";

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Start by figuring out how to get the 3, 5, 6 and 9. If you know how to do that them its easy to find all those numbers below 1000. If you can't do it in your head then write it out with pencil & paper. Think about the process that is needed to get those numbers. Hint: use the mod operator % to determine if a number is evenly divisible by either 3 or 5 and a loop to test each number between 1 and 1000.

[edit]what Nick said too ^^^^^^^[/edit]

manzoor commented: Thanks hint +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There's only one way I know of D = MyFunction(B, I); I suppose you could do something like this too, but it seems sort of silly.

D  = Myfunc(false, I);
D = MyFunc(true,I);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Use it something like this:

char buffer[255] = {0};
int count = 0;
while( kbhit() )
{
    buffer[count++] = getch();
}

Now put something like that in your code. But that will also capture backspaces so you might need to make the above code a little more intelligent by decrementing count when the backspace key is hit. Also if the return value of getch() is 0 that means that a special key such as F1, F2 ... F12, was hit and you need to call getch() a second time to get its value.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

intresting :)

and what are names of the files that correspond to that library?

depends on your compiler because there is no standard naming convention. *nix it's normally in libm.a as Duoas reported. MS-Windows Microsoft compilers the math functions are in one of the c runtime libraries.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Perform a complete antivirus scan and see if it will fix them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Strange women who call me sweety and honey. Drives me up the wall because I might not even know them! If a man said that to a strange woman he would get arrested for sexual harrasment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It doesn't work because Name is not the base class of Employee. You can't call a method of another class unless (1) the method is a static method, or (b) there is an object of Name.

What are you attempting to do there? Maybe you need to make an object of Name inside the Employee class

class Employee
{
public:
    Name name;
...
};

Then you can call name.setName(...);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>employee_list[numEmployees].setName(firstName, lastName);
Hummm -- is numEployees the max number of rows in the employee_list array? If yes then that is array overrun problem. My guess is it should be this: employee_list[numEmployees-1].setName(firstName, lastName); to access the 0 based element of the array.

To call the Name class, assuming Name is the base class of Employee.

void Employee::setName(const char * newFirst, const char * newLast)
{
     Name::setName(newFirst, newLast);   
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>with limitations
That means it isn't working right yet :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So in row 1 3 meet 138 is 9 because there are 9 numbers between those two values.
Lets assume we have those values in an array

int array[11] = {3, 15, 36, 56, 71, 83, 97, 106, 118, 135, 138};
int counter = 0;
int a = 3;
int b = 138;
int i;
// find first value in the array
for(i = 0; i < 11 && array[i] != a; ++i)
    ;
// now increment i until you find the value of [b]b[/b]
// and increment [b]count[/b] on each loop iteration
//
// solution for this is not shown -- don't want to spoil your homework :)
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This is one little problem I see in the code I posted. If the node to be discarded is the first node in the linked list then head->link has to be set to discard->link.

before = NULL;
while (discard->item != item && discard->link != NULL)
{
     before = discard;
     discard = discard->link;
}
// delete discard
if( discard->item == item)
{
    if( before == NULL)
         head->link = discard->link;
    else
        before->link = discard->link;
    delete discard;
}

What the above is doing is removing the discard node from the linked list by setting the link pointer of the previous node to the link pointer of the discard pointer. And before is the previous pointer because the code keeps track of the current pointer before incrementing to the next pointer in the list (line 4).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>how do we divide by shifting to the right
use the >> shift operator x >>= 2; will shift the value of x right 2 and store the result back in x

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 5 is a memory leek because the very next line you toss that memory away. You can combine lines 4, 5 and 6 CartFramePtr discard = head; what I would do is save the previous value of discard before advancing to the next pointer so that you don't have to in line 24-30.

line 8 is also a memory leek

before = discard;
while (discard->item != item && discard->link != NULL)
{
     before = discard;
     discard = discard->link;
}
// delete discard
if( discard->item == item)
{
    before->link = discard->link;
    delete discard;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Glad I was able to help.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> head->item = "";
Head is still uninitialized -- it points to some random location in memory. One way to fix it is like this:

CartFramePtr head = new CartFrame;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>3 meet 36 is 1
how did you get that result? what is the mathametical formula ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My guess is that line 12 of main.cc is wrong -- you are passing an unitialized pointer to that class which is more than likely causing the core dump

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ancient Dragon, the main.cc is listed in my first post.

Oops -- I missed that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It won't help if it is a text file. I was assuming it was a binary file, which I don't think you have.

I think what you might want to do is set SIZE to the maximum size you will need. If you don't need them all then no harm done. Then you don't need lines 32-57 at all.

const int SIZE = 16284;
int array[SIZE] = {0}; //array sized for each file input and initialize all elements to 0

Check limits.h to see if an int on your system can hold that large a number. If not then you should probably use a long, if sizeof(long) is not the same as sizeof(int)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oracle is only one of several popular database. Getting a certificate in Oracle will do little to nothing for you if you work for a company that has some other database.

To become a DBA you need a few years of practical experience working in a large database shop and your master's degree will get your foot into many doors :) After a couple years you will probably be ready to take on a DBA job.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First, the array you declared has only ONE element in each of the two dimensions. If you want them to have two elements then declare it like this: int array[2][2]; >> Ive tried changing it to array[1,0]
That doesn't work in C or C++.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>myIncomingMessage = reinterpret_cast<char*>
you can not return a character array from a function when it has been declared on the stack . The below is wrong because the array will disappear when the function returns, and typcasting will not help that.

char* foo()
{
    char myIncomingMessage[255];

    return myIncomingMessage; // <<<< WRONG
}

There are a couple work-arounds.

1) declare the array as static

char* foo()
{
    [b]static[/b] char myIncomingMessage[255];

    return myIncomingMessage; // <<<< OK
}

or dynamically allocate the array

char* foo()
{
    char *myIncomingMessage = new char[255];

    return myIncomingMessage; // <<<< OK
}
Nemoticchigga commented: Replied timely, and solved my problem +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I win solitaire 38% of the time with a high score of 6196. Don't know if that good or bad though. You might have difficulty seeing the cards if you have your display settings pretty small.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to do it is to create a change file that contains both the old and new values. Then to display all the changes just read that change file. As for the original file, if its a standard text file you will have to completly rewrite the file every time you want to make a change to a records that's already in the file. If you make it a fixed-length record file then you could change the record directly without rewriting the file.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Its not necessary because the array can be treated either way in most cases. Post an example of what you are not sure about.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Then you're out-of-luck. If the author won't release it then you don't have any options left other than try to write the program yourself.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 68 shopping.cc: using an uninitialized variable.

Would you post the test code you have written to test that class? e.g. the *.cc file that contains main()

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

yes. That function can also be called by any *.cpp function that includes file.h. You find this all the time, such as standard header files supplied by your compiler.

// file.h
int foo(); // function prototype
// file.spp
int main()
{
    foo();
    return 0;
}

int foo()
{
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Well, he is an idot. So I don't know what to tell you, unless he is wanting something stupid like this:

int main() { Func1( Func3( Func2(d1,d2) ), c ) {} return 0;}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What is the point in running the program then, if you can't see the program open?

The open() method only makes the file available for reading or writing by your program. It does nothing else. You have to write additional code to read the file into memory so that your program can do something with it. That could be as little as 5 or 6 lines of code or it could be as much as thousands of lines of code depending on what YOU want your program to do. Programs don't do things magically, you have to write the code to make that happen.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 16: That will statically allocate the array based on some random value of SIZE because SIZE was not initialized to anything. What you want is a pointer

int SIZE = 0;
int* array = 0;

lines 32 to 57 is not needed. You can easily get the file size after opening the file, seek to the end of the file, call tellg() and tellg() will give you the file size in bytes. Divide that by sizeof(int) and you have the answer you want.

Now after setting variable SIZE as above you have to allocate memory for the array.

size = new int[SIZE];

lines 60-64 are wrong because eof() doesn't work that way, and because it doesn't write to the array correctly. getline() works with strings, not integers, although you can read integers as strings but then you have to convert the string to an int.

int count = 0;
while(count < SIZE &&  infile >> array[count] )
  count++;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Please stop saying "I tried it and it doesn't work" ! what did you do ? I can't see your monitor from where I'm sitting so you will have to post code, and also post the error statement(s) you compiler puked out at you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

my professor still says its not vaild lol

is it because im missing a function type?

what did you show him?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How will this look if i where to compile this

I'm going to just quickly type this without attempt to compile it

void Func1 (double a, char & c) 
{
}

bool Func2 (double a, double b)
{
    return false;
}

double Func3 (bool a)
{
   return 0.0;
}

int main()
{
    double d1 = 0, d2 = 0;
    char c = 0;
    Func1( Func3( Func2(d1,d2) ), c ) ;
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh, I think I see the problem. Look on line 1 of your program, what is it missing? Where is #include <fstream> ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Either your professor is an idot or you misposted in your original post. See vijay's post #6 above, he already tried it and it works ok. And you can verify it yourself too my writing a small program to test that statement out.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I tried what you said, and it didn't work. Any ideas?

Nobody said anything, so I have no idea what you tried. Post the code.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what's not a valid c++ statement ? Both of them are valid. If you're talking about the second one, functions are frequently nested something like that. The output pf Func2 is passed as the first parameter to Func3, and the output of Func3 is passed as the first parameter to Func1.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

1. if you're using ifstream (meaning input stream) why did you name it outfile instead of infile?

2. what do you mean by "it doesn't work" ? The only reason I know of why your code will not open the file is if there is no such file as "1.1.jpg" in that directory. Its unusual to use two dots in a filename, but its still a legal filename on MS-Windows file system.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Create four more variables, min, mintempnum, max, and maxtempnum then on line 46 check to see if the temp just read is greater than max then set max to temp, and if temp is less than min set min to be temp. set mintempnum and maxtempnum to be the value of i whenever you change min and max.

int min = 0, mintempnum = 0;
int max = 0, maxtempnum = 0;
if( temp[i] > max)
{
    max = temp[i];
    maxtempnum = i;
}
// do the same with min
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Those are C, not C++ header files. You don't use any of them in c++ programs. Some very old Borland compilers such as Turbo C will use graphics.h, but it is not supported by any other compiler.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Get a list of the files by calling one of the os-specific api functions. MS-Wndows its FindFirstFile() and FindNextFile(). *nix its opendir() and readdir().

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

looks like you are attempting to find the minimum value after the array has been cleared.