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

Of course there is -- look at the expected output, it's in ascending order from top to bottom. But maybe that is just a coincidence???

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

Once you get the 12 numbers why not sort them in ascending sequence then print them out like normal? Or is that considered cheating?

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

Try reading their documentation. I don't use QT, I assumed, maybe wrongly, QT supported standard C++ libraries.

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

What language is this? My guess is C# but not sure.

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

what is the expected output?

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

Yes, but you will have to post it because my eyes are not good enough to see your monitor from where I am sitting.

AFAIK there are no win32 api functions named PutText() and GetText().

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

Most likely you got some sql error(s), for example you might be attempting to insert a new row with data that duplicates a row already in the table and the column is marked as unique.

First check the table to make sure it is not trying to insert a new row with duplicate data. If that's ok then print out the contents of the query just before calling SQLPrepare() so you can see what it contains.

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

In Windows if we create an exe with MSVC6.0 a corresponding ".lib" file is generated.

No it is not. The lib file is only generated if you create a library project.

In *nix you have to create a shared library. How to do that will depend on your compiler. Here are some tutorials.

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

If you are trying to get rid of a virus wouldn't it be a lot easier to just run an antivirus program and let it remove the virus then to reinstall the operating system?

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

Be aware that such a file is going to get pretty large very quickly if there are a lot of users being tracked, and you have only one function or program actually writing the data because it has to have exclusive use of the file in order to write it.

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

call srand() at the very beginnning of the program, and before the first time rand() is used. Usually srand() is called with the return value from time() so that srand() gets a different number every time it is called. That will prevent rand() from returning the same set of numbers each time you run the program.

srand((unsigned int)time(0));

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

Does it mean that if i put for example

Yes, you got it correct :)

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

im afraid if i understood this assignment unproperly:

Seems pretty clear assignment to me. What part don't you understand?

Since you have to work with each digit of the number it would probably be easier to get the number as a string instead of an integer. It can be done with an integer but it's a little more complicated.

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

Unless it's a binary file where you know the offset to the data you want, the only way to read the pieces you need is to read the whole file then extract the data from that. With text files it's impossible to seek to the data because you never know exactly where it's at.

First read a line of the file into std::string, then use string's find() method to search for the colon. That will give you the position within the string where the colon is found. use substr() to extract the rest of the line and do whatever you want with it.

You might also be able to do that with getline() using the colon as the separator.

std::string str;

ifstream in("filename.txt");
while( getline(in,str,':')
{
    getline(str,'\n');
    int var = atoi(str.c_str());
}
butterfingerss commented: So you're saying that it would be easier in a binary file? +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It' just standard c++ ifstream and ofstream. When the program starts, try to open the file, if it success then read it.

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

You have to include stdlib.h

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

Do you have a question?

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

What has your rant have to do with DaniWeb? No one at DaniWeb can do anything about bad google results. Maybe you are just entering the wrong keywords in google??

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

Dev-C++ is nothing more than an IDE -- it's not a compiler. MinGW is the compiler that is supplied with Dev-C++, same compiler that is supplied with Code::Blocks IDE. And MinGW is the Windows port of *nix gcc and g++ from GNU.

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

Like so,this works for me:

You need a different compiler.

I think it is possible to do that

You can not have one function inside another function in either C or C++ languages. You can declare a function prototype inside a function, but the function itself has to be coded outside any other function.

#include <stdio.h>
#include <string.h>

int main()
{
  char name[5][50];
  int numofname = 5;
  int i;

void getname(char name[][50],int numofname); // this is ok

 for( i = 0;i < 5; i++)
   getname(name,numofname);

 for( i = 0;i < numofname; i++)
    printf("%d : %s\n", i, name[i]);

  return 0;
}      
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I would use sprintf() to format the string

char namne[20], sc[5];
char query[255] = {0};
// fill in name and sc not shown here

sprintf(query,"INSERT INTO scores (Player,Score) VALUES ('%s','%s');",
  name,sc);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is it correct? No. You can't nest one function inside another.

    #include <stdio.h>
    #incluede <string.h>
    void getname(char  name[][50],int num)

    int main()
    {
        char name[5][50];
        int numofname = 5;
        getname(name,numofname);
     }      

     void getname(char name[][50],int numofname)
     {
            for(int i=0;i<numofname;++)
            scanf("%[^\n]",name[i]);
     }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just compiled it with VS 2013, all I had to do was compile as C program and do some typecasting. Make sure the file name has *.c file extension, not *cpp.

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

Like I said, just copy the files (link)

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

what's the difference?

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

How do you get that XP will become open source? reactos is just writing a Windows os alternative, no mention of what version.

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

Maybe you need a different compiler. Install Code::Blocks with MinGW compiler -- it's free.

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

Missing quotes around the last item tsxid.Text

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

Anyone know where to BUY (not steal) this eBook? I don't want paperback because they are too difficult for me to read. I'd rather have eBook or PDF version so that I can change the font size to whatever I want. I've looked at Addison-Wesley web site but don't see it. I've looked at anothere site and all they have are used copies of paperback books. The only thing google shows me is illegal downloads.

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

You can't, you have to buy them.

Ravi_16 commented: However , you can use trail for 30 days from the time of installation :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here are some books that may help you. Experience is probably the best teacher. IMO most of the features of Visual Studio are just fluff, the best and most useful feature is it's debugger. One feature I don't like is it's dockable windows -- I'm always accidently undocking one of them and spend a lot of time and effort trying to put it back the way it was. I wish there was a way to lock all those windows in place so that they can't be moved.

You might want to upgrade to Visual Studio 2013 Express. It's c++ compiler more closely implements c++ standards than earlier versions.

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

What are you confused about?

for i ← 0 to n − 1 do

In c++ this would be for(i = 0; i < n-1; ;)

or it could be coded as a do loop

int i = 0;
do {
  // something
} while( i < n-1);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

But you quoted the wrong person. I'm the one who made comments that Mike quoted in his post.

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

Jwenting: You mixed up who said what.

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

Is input[1] just a single numeric digit? If it is, then you don't need any conversion program, just subtract '0' to convert it to integer.

For example:

char input[] = "X1";
int x = input[1] - '0';
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Microsoft has no intention of telling anyone they can't use XP. They just said they will no longer support it. Users can still use it for as long as they like.

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

The gun tax was applied in 1937, long before today's gun problems.

Statistically, one of the primary uses for firearms is to commit suicide

Where did you get that bit of misinformation? According to National Center for Health Statistics (link), there were 2,169,518 deaths in the USA, of those 1,441 were from firearms and 30,810 were suiside (about 60% involved firearms). According the that same article there are approximately 200 million firearms in the US. I don't see any statistical significance in that, even considering the data is now pretty old.

A more recent article (2005) shows that American's own guns for one or more of three reasons: protect themselves against crime, for hunting, and for target shooting.

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

You would never say there were 17.5 people at the party.

According to the US Census Bureau the average family is 2.5 people (link).

The average population per household now stands at 2.55, down from 3.67 in 1948.

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

If anyone owns the intellectual property of "Sky" is has to be American TV NBC who ran the TV series "Sky King" in the early 1950s. It was a ratio broadcase before that.

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

"%c" only gets one character from the keyboard. I see the structure contains several character arrays, so "%s" is probably more appropriate. Also, it's not necessary to use & before character arrays because they are already passed as pointer by default. For example

scanf("%s",stud.vpisna_st);

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

The problem with that is FindFirstFile and FindNextFile know nothing about std::vector, or even c++. Those are just C functions. In order to make your suggestion work you would first have to resize the vector with enough entries to hold all the files that those two C functions might return, and you have no way of knowing that without first counting the files. Of course you could just resize the vector with some arbitrarily large number in hopes that it will be enough.

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

Here's an article about a year old that you might find interesting about Democrat votor fraud.

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

What and where were the errors?

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

If there is a WW3 it won't last long. There's enough nukes in the world to destroy the planet several times over in just a few minutes. So you won't have to worry about WW3 very long.

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

There are lots of sorting algorithms, c++ even has one. Are you allowed to use the standard c++ std::sort function? If not, then probably the simplest one to code is the bubble sort. The bubble sort is among the slowest of the sort algorithms, but for small sets of data and for data that's already almost sorted it is ok.

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

No -- there's no one here that knows how to program :) And if you believe that I have some shares in the Golden Gate Bridge that I'll be glad to sell you.

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

you might want to display those two strings or write them to a temp file so that you can see exactly what is being sent to the database.

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

The world's longest living married couple are Karam and Kartari Chand, living in Bradford, UK. They have been married over 88 years! (link)

The only nation in the world to have a nonrectangular flag is Nepal (link), located in the Himalayas and bordered to the north by the People's Republic of China. The first time I recall seeing it was at the Olympics in Russia a few weeks ago.

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

Did you try this?