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

line 13: remove the colon after other

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

The only other problem I see is the comma at the end of the last line which may or may not be a problem. Remove it and see if that fixes it. You might also shorten the names of each field -- long names may be very descriptive but can be a bitch to work with. Some databases may have a limit on the length of field names.

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

You want to sort all the structures by score? If yes, which score? Say each instance of the structure contains 20 scores, which of those 20 scores do you want to use to sort all the structures?

Or do you just want to sort all the scores within each instance of the structure. That's pretty straight forward -- add a Sort() function and pass the array of scores to it so that Sort() can sort them.

To search by Name (or any other field) you need a Search() function.

Note that putting all this in main() is a very BAD idea -- use functions to make the code more readable and understandable.

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

Check if the table already exists.

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

That's right -- your Cow class has no member functions. Compare what you posted with what I posted. You can't just simply remove Speak() out of the class like you did.

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

Went to Good Old Days restarant, had bisquettes & gravy and two scrambled eggs. They make the best bisquettes & gravy this side of UK :)

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

ptr[i] = malloc(sizeof(the_struct));

should be this:
ptr[i] = malloc(sizeof(struct the_struct));

Occasionally I confuse C and C++. In C++ the keyword struct is not required. Sorry for the confusion.

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

#define TICKS_PER_SECOND ((GetPeripheralClock()+128ull)/256ull

The compiler sees GetPeripheralClock() as a function call -- remove the ()

#define TICKS_PER_SECOND ((GetPeripheralClock+128ull)/256ull

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

Probably the parentheses on line 1. Remove them and see if it compiles.

#define GetSystemClock 200000000UL

Same with line 3

#define GetPeripheralClock GetSystemClock

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

Yes, I realized that afer re-reading your original post. Re-read my post and you will see that I corrected it. And I agree with you about typecasting malloc in C programs.

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

As sepp2k alreay said, you can malloc ptr because it's already an array of 100 pinters. Instead you will have to malloc each individual pointer

for (i=0;i<=n;i++)
{
   ptr[i] = malloc(sizeof(the_struct));
   ...
}

what type should it be so it could hold char and int?

It holds the_struct which is neither char nor int. the_struct is a user-defined data type.

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

My son and I went to Outback Steakhouse this evening. Yuuumy! I had a Porterhouse steak, very tender and tasted great. I love their Blooming Onion

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

virtual implies that the function can be overridden by some derived class. The reason you might do that is to implement the function differently in the derived class then it is in the base class. Here is a simple example

class Animal
{
public:
   virtual void Speak()
   {
      cout << "Wolf!\n";
    }
};


class Cat : public Animal
{
  virtual void Speak()
  {
     cout << "Meow!\n");
  }
};

class Cow  public Animal
{
  virtual void Speak()
  {
     cout << "Moo!\n");
  }
};

Notice that each derived class, Cat and Cow, change the behavior of function Speak. If the derived class does not override Speak then the base class Speak function is called.

In your example class a does not override print() from the base class, so you can't have a::print(), it must be test::print().

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

Resolve what problem? What do you need more info about?

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

The function is still in test class, not a class.

void test::print(string message)

line 11 is not quite right either

class a:public test
{
public:
   a() { print("Hello from Class a\n") };
}

the function is changed outside of class 'test'.

The function can not be "changed", but it can be "called" as in my example above. Well, that's not entirely true either, which you will learn when you get to more advanced c++ topics.

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

but how these class are done?
because we use what messages we need and not all in class

In MFC it's very complicated, there are many levels of inherentence. Here is a hierarcy chart of MFC classes. Most MFC classes use CObject as the base class. Then visual objects are derived from CView, so you get something like this:

CObject --> CView --> CButton 
                  --> CCheckbox
                  --> CComboBox
                  --> CMenu
                  ,,,

MFC uses a system of message notifications to pass messages around the system. When you press a key the keypess event is sent to the current active window. Same with mouse clicks. Many other events are generated by MS-Windows operating system and sent to the active application program. When your MFC programs receives a message it determines which MFC object should get it and passes the message off to it. This whole process is pretty complicated but you can via VC++ debugger trace through that process (yes, I've done that in order to gain understanding of what is going on).

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

Simple -- just inherit the base class

class Base
{
   ....
};

class Derived : public Base
{

};

Everything that's in Base class is now available ikn Derived. Just normal c++.

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

Yes, I agree.

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

line 17 is wrong. If you enter the string "Hello" why would you check all 100 bytes of the array when only the first 5 bytes are used?

for(i = 0; i < 10; i++)
{
   int len = strlen(z[i]);
   for(j = 0; j < len; j++)

i want the o/p array to be sorted in ascending order of vowels each of the string contain

I don't get it. If the strings are
"Hello"
"World"
In which order should those two strings appear?

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

CMyAxUICtrl is a class, not an instance of a class.

but it's used outside of main function:

Do you mean it's used in some other function? main() has nothing to do with it.

Looks to me what you posted is the implementation for OnDraw(). That's just normal c++.

I wouldn't bother learning much MFC -- it's pretty much obsolete now. New progarams will most likely be written in C# or C++/CLR.

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

Let's say you enter the number 5. That means you need to print 5 rows and each row has 5 numbers. The first number on the row tells you how to show the numbers on that row, for example row 1 all the numbers are in sequence 1,2,3,4 and 5. Row 2 you print every other number, such as 2, 4, 6, 8, and 10.

You don't actually use an array or matrix to do this.

I think the simplest way to solve this problem is to use two nested loops

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

What compiler are you using? I don't get any errors with Visual C++ 2013.

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

running a custom shell and file manager also helps detour alot of threats.

So does avoiding web sites known for spam/malware, i.e. porn sites and downloading pirated software.

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

I would be more excited if it said "You accumulated $1,000.00" :)

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

I rather like the idea of rep and post counts dropping off after 6-12 months. What I did 8 years ago has little relevance today.

I'm not very crazy about the idea of paying people (however little) to answer questions. I do it because I want to, not because you will pay me for it. I'm completely satisfied with doing it for free. I may not participage even if asked.

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

That works with normal text file, has nothing to do with Notepad.exe.

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

So I thought it would be a part of C++ .

It is, but if this is really a c++ program the be consistent and use c++. If not, then this whole thread is in the wrong forum.

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

I think your poblem is line 28: After reading the last line in the file line 28 attempts to read the next line, indexing one beyond the end of the q array. Change the while on line 26 to while( i < n)

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

how is pin declared? You never posted it, so no one here really knows. In order for that to work pin must be a character array. If pin is an int then you need to use "%d" instead of "%s"

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

Maybe Microsoft has become too big a monster for it's own good. Government should split it up like they did AT&T in 1982.

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

Look at line 32 -- it's gets(), not cout. gets() waits for you to enter a string from the keyboard and overwrites whatever was in that character array.

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

why the loop on line 30? that is destroying the contents of the file that was read on likne 26.

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

You could use defines instead of the enum on line 1 but that wouldn't be any beneficial than what you have now.

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

Sorry, you are way beyond my skills. Maybe Mike (a DaniWeb moderator and Ph.D. candidate) can help you.

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

If you can't hook into notepad xml will do you no good.

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

What's your educational level? Ph.D. is preferable for doing such research.

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

The only way I know of is to rewrite the file before Notepad (or some other program) gets it. I doubt Notepad.exe has a hook where you can intercept the file that it reads.

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

How is pin declared? Assuming it's char pin[5]; line 6 should be
scanf_s("%s", pin); Note you don't need the & address symbol because the compiler will always pass the address of arrays.

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

if some-one gets relief from their chronic pain by taking sugar pills is it right to stop them from taking them?

The problem is not the sugar pills but the doctors who lie about what the pills really are. I understand about tests -- subjects can't know about who is taking placebos and how isn't.

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

I think you will have to use something like Skype to do that, or you can spend a couple years reinventing the wheel by writing your own Skype program.

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

@mridul.ahuja: This is c++, not c.

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

that says nothing about not being able to use VT_EXPANDTABS with DT_SINGLELINE or DT_VCENTER. The link you posted is the same one I posted. If you want to use '\n' or '\r' then you have to parse it yourself and split the line at '\n'

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

Did you try DT_EXPANDTABS ?

DT_SINGLELINE
Displays text on a single line only. Carriage returns and line feeds do not break the line.

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

I just successfully registered at bigfishtackle.com. Maybe this thread should be moved to Hardware and Software where someone can help you resolve the problem.

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

In c++ a struct is nearly identical to a class. Just rename the struct to class and make members public

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

You don't need an array. lines 14, 15 and 16 is the wrong kind of loop. There is no restriction on the number of integers that can be entered. You could enter a billion numbers if you desire.

You only have to keep track of 2 things: sum of the numbers entered, and how many numbers you entered. Each time you enter a positived number just add it to the sum counter. No reason to save the numbers in an array.

line 26: if(input%2 == 0 || input%2 != 0)

What is that supposed to do? Since there is no other possibility that line is pretty much useless and the break on line 29 will never get executed.

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

The second one is because l_aAPtr is an array.

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

Huh? There is no such c++ function as waitKey.

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

Name one of the sites that you can not register.

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

What is the return type of function rankfun?

Look at line 3 -- it says it all.