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

Yes, I think I do understand the problem, maybe you don't understand the solution.

#include<iostream>
using namespace std;
int main()
{
    int a[10] = { 5, 2, 10, 25, 4, 9, 7, 25, 8, 3 };
    int largest_1 = 0, largest_2 = 0, largest_3 = 0;

    for (int i = 0; i<10; i++)
    {
        if (a[i] >= largest_3 && a[i] <= largest_2)
        {
            largest_3 = a[i];
        }
        else if (a[i] >= largest_2 && a[i] <= largest_1)
        {
            largest_3 = largest_2;
            largest_2 = a[i];
        }
        else if (a[i] >= largest_1)
        {
            largest_3 = largest_2;
            largest_2 = largest_1;
            largest_1 = a[i];
        }
    }
    cout << "largest :" << largest_1 << endl;
    cout << "2nd largest :" << largest_2 << endl;
    cout << "3rd largest :" << largest_3 << endl;
    cin.get();
    return 0;
}

And the output is this:

largest :25
2nd largest :25
3rd largest :10

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

And with a pair of unsterilised cissors even, recipe for serious infections.

I'd wipe then off on my muddy cow-shit ridden cloths first :)

I was actully just joking when I made that remark, then someone pointed out it was a serious option.

Stuugie commented: lmfao, does nobody here see this humour? +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

So if you have 3 numbers all the same you want the 1st, 2nd and 3d largest to be that same number?

I just tried it -- use <= and >= instead of < and > in each of the if statements.

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

ListBox has a FindString() method. When you enter text in the textbox, pass the text on to ListBox.FindString(). If you need anything more complex searching then that, I'm afraid you will have to do the work yourself as deceptikon said.

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

delete line 2, conio.h is not needed.

replace line 36 with cin.get().

what data did you enter? Your program worked correctly for me

#include<iostream>
using namespace std;
int main()
{
    int a[10] = { 5, 2, 10, 25, 4, 9, 7, 6, 8, 3 };
    int largest_1 = 0, largest_2 = 0, largest_3 = 0;

    for (int i = 0; i<10; i++)
    {
        if (a[i] > largest_3 && a[i] < largest_2)
        {
            largest_3 = a[i];
        }
        else if (a[i] > largest_2 && a[i] < largest_1)
        {
            largest_3 = largest_2;
            largest_2 = a[i];
        }
        else if (a[i] > largest_1)
        {
            largest_3 = largest_2;
            largest_2 = largest_1;
            largest_1 = a[i];
        }
    }
    cout << "largest :" << largest_1 << endl;
    cout << "2nd largest :" << largest_2 << endl;
    cout << "3rd largest :" << largest_3 << endl;
    cin.get();
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If they stand up they are also more likely to freeze in the winter.

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

i am just curious to know if there are any at home remedies that I can make for him

Use a pair of sizzers and cut them off.

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

can't help you without the code you wrote.

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

Move the include statement down below to line 4, after the ifdef statement. Yes, you can put include statements in header files, it's done all the time.

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

The arrays are declared as two-dimensional arrays and line 26 is trying to treat them as one-dimensional arrays. Why are they two-dimensional instead of one dimensional arrays?

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

Post the code you have written so that we can see where your "issues" are.

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

I'm using IE11 and I see that but in a circle, it's a square like you showed in the member's Profile page. It looks like that on Chrome too. My guess is that's the way it's supposed to be.

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

try this

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

Look at that line very carefully -- the while statement is an infinite loop.

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

Program doesn't reach line 75.

That's because of the problem on line 70. Sorry, my previous post was incorrect, it should have said line 70 not line 75.

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

That's a new feature of c++11 iso standards. Some compilers such as Visual Studio have not implemented it yet, while others such as g++ may need special flags.

For compiles that don't support that, just change line 81 to this:

string* boardWithPieces = new string[rowLength*columnLenght];

As for the freezing problem -- look at line 75 and see if you can figure out what's wrong with it (Note: very common error)

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

You include .h header files, not DLLs. Header files are very simple -- the compiler's preprocessor adds those files to your program in the spot where you have the #include directive. link

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

Most likely the problem is compiler mangling names. c++ compilers change function names so that they can be overriden, while c compilers do not because c does not support overiding functions.

The most common way to prevent name mangling is like this

#ifdef __cplusplus
extern c {
#endif
#include "widget.h"
#include "ui_widget.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
#include "opencv/cvaux.h"
#ifdef __cplusplus
extern }
#endif

You should check your compiler to see if __cplucplus is defined when compiling c++ code. vc++ defines it but I don't know about other compilers.

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

am wondering why would one need to swapp the numbers in real life?

One very good reason is sorting numbers in either ascending or descending sequence.

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

great :) so now your problem is solved??

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

Lines 1-4 are all incorrect. You can't declare character arrays like that and you can't use gets() like that. I think you need to pay more careful attention to how those are done. For example

char in[20];

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

look up strstr() function. Another way is to call strncmp()

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

Is it possible that I could get it back?

Probably not -- you auto lose the badge when the period of your donation expires. For example if you donate $3 for one month and don't renew it the badge will only appear for the month of the donation. It's not permanent.

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

c++ is completely object oriented programming language.

No it isn't.

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

There are two kinds of strings -- standard strings are char* which are 1 byte per character. This is normal in English language and a few other languages too. The other kind of strings are UNICODE strings, or wchar_t*, where each character is represented in two or more bytes. All languages, that I know of, can be represented in UNICODE characters.

Look at line 15 of the code you posted. LPCTSTR is a Microsoft typecast for const char*. Now in line 33 you declare a pointer of type TCHAR, which is another Microsoft macro (tchar.h) that can be either char* or wchar_t* depending on whether you compile the program for UNICODE or not. line 50 calls the function wcscpy() which is UNICODE only function that is the same as strcpy() but takes two wchar_t* parameters instead of two char* parameters.

In otherwids, you code is mixing two very different character types, char* and wchar_t*. Both client and server must speak the same language (use the same character representation). What I would do if I were you would be change OnClickedBsend() to use UNICODE strings just like OnReceive().

Here is a much more complete explanation

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

void* is just a generic term for a pointer of any type. For example, malloc() returns void*. If you really want a pointer of type char* then, in c++, you have to typecast the return value of malloc().

char* p = (char*)malloc(15);

In the above, malloc will allocate memory for 15 bytes of memory and return a pointer to that memory block. Since pointers are all the same size in c++ you can easily just typecast it to whatever kind of pointer you want.

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

That's because g points to an entire class and you need a friend class that prints all of it. cout has no idea how to display the class.

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

ifstream and ofstream cannot be members of a class like you have them. It's probably better to just have inData() and outData() declare ifstream/ofstrem, open the file, then read/write.

void Billionaire::outData()
{
    ofstream outFile("filename.txt");
    //The output data is formatted accordingly
    outFile
        << setw(12) << "Name: " << getName() << endl
        << setw(17) << "Rank: " << getRank()
        << setw(12) << "Worth:" << left << setw(8) << getWorth() << right
        << setw(17) << "Age: " << getAge() << endl
        << setw(12) << "Source: " << getSource() << endl
        << setw(17) << "Country: " << getCountry() << endl << endl;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

remove the asterisk

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

iterators are pointers and need the -> operator not the dot operator

            cout << left << setw(0) << "--d" << diskQueue.size() << left << setw(4) << " "
                << left << setw(14) << g->getFilename() << left << setw(14) << g->getMemoryStart()
                << left << setw(14) << g->getFileLength() << g->getRW() << endl;
smitsky commented: Excellent help! +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Remove const keyword after PCB::screen. const functions can't use the iterator.

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

Remove const keyword after PCB::screen.

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

Looks like it is sending char* (line 15) and receiving wchar_t* (line 40)? Is that right? I don't think that will work. Suggest you change OnClickedBsend() to convert the string from char* to wchar_t* before sending it.

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

// t-1 = second last and t-2 = secound first

What?? The second last is t-2, the second first is 1. Why do you need loops to find the second last and second first numbers?

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

multi-statement for loops and if statements require { and } around them

for(i = 0; i < 10; i++)
{
   // blabla
}

line 23: y < y will never ever be true. Probably should be y < 10

Brittany_1 commented: I can't believe I overlooked the curly Qs. Changing line 23 helped also. Now the only problem I'm having is that when it asks for input for the test scores, it's only asking for the last person's name entered. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is this the only one that's unplayable or are all the dvds you burn (using different files) unplayable?

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

Probably depends on what compiler you are using. Here's the output from VC++ 2013

1   1
2   3
3   9
4   33
5   153
6   873
7   5913
8   46233
9   409113
10   4037913
11   43954713
12   522956313
13   2455009817
14   3733955097
15   5738265113
Press any key to continue . . .
newbiewwcode commented: Thanks for helping. I got it to work. when it does the addition, long long got demoted to an int type. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just tried it and had a similar problem, but I just hit the back arrow located in the top left corner and it returned to the correct screen. There are a lot of pictures (icons) it has to download so if you have a slow internet connection it might take awhile to load them all.

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

What did you burn? If it was pirated then that may be the reason the dvd won't play.

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

Since you didn't post any code there's not a whole lot anyone can suggest.

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

Your two links are broken.

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

line 102 is wrong

void heapInsert(int **A, int &size, int Item)

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

lines 1-10 are incorrect -- all line 1 does is declare an array of pointers, not an array of integers

int *A = new int[10];
    A[0] = 4;
    A[1] = 1;
    A[2] = 3;
    A[3] = 2;
    A[4] = 16;
    A[5] = 9;
    A[6] = 10;
    A[7] = 14;
    A[8] = 8;

line 15: should be printArray(A, size);

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

repost the probram and tell me what line the error is on. If this error is in main() than most likely it's because you have to pass a pointer to A, for example if A is a pointer then

heapInsert(&A, ... )

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

After thinking about it, this might be a bit easier to work with

void heapInsert(int **A, int &size, int Item)
{

    size = size + 1;
    int i = size - 1;
    int *B = new int[size];
    memcpy(B, *A, (size - 1)*sizeof(int)); // copy old array to new

    while (i > 0 && B[getParent(i)] < Item)
    {
        B[i] = B[getParent(i)];
        i = getParent(i / 2 - 1);
        cout << B[i] << endl;
        //i = getParent(i);
    }
    B[i] = Item;
    delete[] * A;
    *A = B;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, some of the other functions will also have to change, especially those called from main()

void heapInsert(int **A, int &size, int Item)
{

    size = size + 1;
    int i = size - 1;
    int *B = new int[size];
    memcpy(B, *A, (size-1)*sizeof(int)); // copy old array to new
    delete[] *A;
    *A = B;

    while(i > 0 && *A[getParent(i)] < Item)
    {
        *A[i] = *A[getParent(i)]; 
        i = getParent(i/2 - 1);
        cout << *A[i] << endl;
        //i = getParent(i);
    }
    *A[i] = Item;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

array B in that function has no value because it doesn't change the size of array A.

In main(), change array A to be a pointer and initially allocate it to contain 10 elements. Then in heapInsert increase the size of A by 1. You will have to change the signature of heapInsert() a little because you have to pass a pointer to a pointer so that heapInert() can change the address of the pointer in main().

void heapInsert(int **A, int &size, int Item)

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

Yes, the array has to be dynamically allocated, then in heapInsert() you have to increase the size of the array to accommodate the new element. That becomes much easier and faster if you used a standard tree of allocated nodes instead of putting everything in one big chunck of memory.

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

Probably because heapInsert() changes the value of size from 10 to 11 and there aren't 11 elements in the array. You can't just arbitrarily change the size of a statically declared array.

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

When is a tablet not a tablet but a notebook? I bought my college grandaughter a Microsoft Surface with keyboard about 6 months ago and she loves it, a lot lighter than a notebook and the keyboard is slient. That's really about the only difference between the Surface that I bought here and a standard notebook.