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

So what are the errors your compiler makes? I suspect it doesn't like lines 1, 2, 3 or 8. The header file on line 3 is not supported by 32-bit compilers such as Dev-C++ and the other ones are just obsolete -- you should use the version without the *.h extension. Your program also doesn't need line 6, since its not using anything from stdio.h.

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

You still didn't explain why you are using uninitialized variable y.

Also, please post the data file.

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

There is no reason for such a forum. How may people have posted questions on DaniWeb about mobile? I suspect next to 0. Dani won't add new forums unless there is a clear and large demand for one. One person (you) does not a large demand make.

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

It's right under a person's name+pic

Yea, I discovered that after making that silly post.

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

There is no "Post Reply" button. Do you mean "Post Reply to this Thread" button that's below the quick edit box?

[eddit]Oh! guess I must be blind. :)

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

>>But how does that help me find the post? I don't know how to find post 1221433
Exactly. I should have use the [sarcastic] tags. If the post number is not allowed for the reasons Dani mentioned then quotes should also not be allowed because they will have the same identical problems.

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

Ok, so now instead of saying See Post #5 we can say See Post #post1221433.

And where did the Quote link go??? I'm using IE8 and don't see any way to quote someone. I know there's got to be a way to do it, but whatever it is it's sure obscure now. How do you expect new members to do it if old farts like me can't.

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

After posting a response to one of the threads listed by the Unanswered Threads link, the thread still appears when that link is clicked again. It shows that I've answered it, but it shouldn't be in that list at all now becuse it ain't no longer unanswered :)

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

Easily done with SQL.

SELECT Username,Name,Login.Group,Groupname
FROM Login, Group
WHERE login.Group = Group.Group

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

Maybe this will help you

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

lines 19-22. The variable y is used before it is assigned a value. Consequently it just contains some random value.

lines 39-48: Why are you reading that file 100 times? Do you really expect the data inside the file will change on you? I understand why you might do that if you are trying to profile your program, but I don't see that happening either.

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

>>I can compile and run the program
Not with Dev-C++ you didn't.

>>"gotoxy(15,2)";

What the hell is that!

Why did you put a function call in quotes? Answer: because you most likely plagerized this code from someone else who write it for Turbo C. You should have just deleted those lines instead of putting them in quotes.

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

That error message means you compiled the program for UNICODE. You can do that, but you have to change strings to unicode strings. There are several ways to do it, but IMHO the best way is to use the _TEXT() macro, for example ofn.lpstrFilter = _TEXT("All\0*.*\0Text\0*.TXT\0"); Doing that the program will compile correctly whether or not the program is compiled for UNICODE.

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

>>P.S I don't and won't use string, my GUI doesn't like it.

It doesn't like it most likely because you tried to pass std::string to a function that expects char*. To fix that all you have to do is use string's c_str() method. foo( mystring.c_str() );

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

>>What to learn first: .net, win32 or MFC

None of the above. The next step is to learn c++ because both MFC and .NET use c++ extensively. After c++ I would probably learn CLR/C++, saving MFC for last, if at all. It would be better choice to learn C# than MFC.

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

Write the program in small steps, don't try to do everything all at once. Start out by writing the program that does nothing more than display the menu. Get that coded, compiled without error, and tested. Once you do that then go on the the next step which would be to get the menu item from the user, such as use scanf(). After that continue with the rest of the program, again taken in small pieces.

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

Just logged on after 24 hours.
1) I liked the revised buttons that are now clickable. That's a good improvement

2) Don't like the way the badges were implemented. Although they are usable they are not as nice looking as in the previous version of DaniWeb. In previous versions it was immediately obvious who the mods were -- that is more obscure now unless of course you know who they are anyway.

I don't like the way the badge popup is shown whenever the mouse hovers on any part of the user name column, such as it pops up even when you put the mouse on the Edit/Delete button. IMO it should only pop up when the mouse is over the avatar or user name.

3) The "Edit/Delete" button still has not been changed to just "Edit". It does no harm to leave it, but its such a simple change that should take someone only a few seconds to fix.

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

First, do no use two different loops to calculate the minimum and maximum values -- do that all in the same loop. When the program gets to that second loop to calculate the minimum value the file pointer is already at end-of-file so the loop don't do anything. Just combine both loops by putting the if statement in the second loop after the if statement in the first loop. Don't forget to move the other two lines as well into the first loop.

Other than that, I don't see offhand what caused the seg fault.

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

>>can u rewrite the code...
Yes I can -- but I won't. You will never learn how to write programs if other people do your work for you. Post your attempts to solve it then ask questions. I already gave you a couple hints.

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

Probably because that code prints the EOF character. Try this one. Variable C needs to be int, not char.

int c;
while( (c = getchar()) != EOF)
   putchar(c);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The first problem is that you are attempting to use unallocated pointers -- can't do that. You have to allocate space for all the characters you want to put into them. Declare them something like this: char str[255] = {0}; ; You can replace the value of 255 with anything you want, as long as its large enough to hold all the charcters you want to put into that string.

Second problem is your use of the function gets(). Don't use gets() for anything -- ever. Use fgets() then remove the '\n' that fgets() adds to the end of the string.

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

Glad to see the "First Unread" button, but would rather the New button did the same thing, as it did in the old version of DaniWeb.

I still miss the pencil, or some other way to tell the threads that I have posted in.

It would be nice to have a color selection option in our Profile so that everyone can customize DaniWeb anyway they want. I think I've seen that in some sites. There are some places that even allow me to customize the entire theme.

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

Put a breakpoint somewhere in your program to prevent it from closing. There should be an icon on the taskbar that you can click to restore the console window where the error message is.

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

Use VC++ 2010 Express and it has a toolbar that contains all available standard controls. Go to www.codeproject.com and they have lots more of them. Of course these are for GUI programs, not console programs.

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

use getline() to read the file line by line, then parse the string

>>getline() does not work with no arguments
Of course not -- you have to pass appropriate argument

std::string line;
ifstream inFile("filename.txt");
while( getline(inFile, line) )
{
   // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The "Unanswered Threads" link at the bottom doesn't show the forum names. That was very useful because I could just ignore those that I was not interested in. Now I have to click every link to find out what forum its in. That makes Unanswered Threads nearly useless.

[edit]Well, I found the forum names -- its soooo obscure like its just an afterthought. It takes a whole lot more time to scan the list of links and pick out only those for the forums I want.

And what is Trending? An odd name for something :)

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

>>Here is what I have passing...
>>count - the total numbers of scores I am entering so it will vary
>>mean - it is from the mean function and it just the total of all the scores >>vided my the count so it will vary
>>totaScores- this adds up the scores so it will vary

Yes I know that -- what I am looking for are numbers, not explanation.

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

According to this wiki article your sd function needs to do more work.

First you will need an array to hold all the scores until after the mean is calculated.

Next you need to change the function calculateMean() to return the mean value so that main() can use it. As it is, the value of mean is 0 in main() even though it's calculated in that function. main() knows nothing about the value of mean in calculateMean().

After calculate mean, you need to calculate the sum of the difference between each value and the mean. That's where you need the array that contains the original scores.

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

What I mean is what values are you passing for double mean, double count, double totalScores ? If you don't know what they are then just print their values on the screen so that you can read them and post them here.

Two scores will not get you much for standard deviation, and most likely why you are having the problems you report. Suggest you create a file that contains 50 or more scores then have your program read them and make the computations.

Or if you don't what to do that, you can have your program generate 50 or so randm numbers so that you don't have to type them in every time you run your program.

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

This thread was originally posted 5 years ago, before that version of the compiler existed. So use the code at your own risk.

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

>> typedef unsigned short int HWND; // 4 bytes

Maybe, and then again maybe not. On my computer (windows 7) sizeof(short) = 2 bytes, not 4. But of course that comment has nothing to do with your problem

>>well part of the header file, it's rather long)
Check the header file to see if there are any other #if preprocessor statements that are causing the function prototypes to be commented out.

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

You can't keep the user from typing on the keyboard but you can remove all remaining keys from the keyboard input buffer. If you are using c++ cin then read this thread to find out how to flush the input buffer.

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

What are the values of the parameters? Perhaps they are wrong.

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

>> I keep getting a 1.#f
That means it is a very large or very small number. Add fixed to the cout line and cout will display it correctly cout << fixed << 0.000001 << '\n';

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

You can put the implementation code in the header file (called inline functions) and not use the implementation file. But I'd only use this technique for small methods.

#ifndef FOO_H_
#define FOO_H_

class foo {
public:
    foo()
    {
       _x = 0;
    {
    virtual ~foo()
    {

    {
    void SayHello()
    {
       cout << "Hello\n";
    }
private:
    int _x;
};
#endif /* FOO_H_ */
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You could try Sane's Monthly Algorithms Challenges which are designed for people of all programming levels.

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

Another problem: Just noticed this in Geeks' Lounge: there is no page count on multiple-page posts. I don't want to have to scroll through all 500 or so posts to get to the last post of a thread.

Oh! nevermind. I just saw it on this thread :icon_redface:

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

1) I like the new ribbon at the bottom that contains MFF Today's Posts etc. Problem is once you click on MFF there is no way to remove the popup menu.

2) I liked the old color scheme better than this purple -- but we'll get used to this one.

3) I don't like that Popularity column -- seems redundent with the Reply count immediately next to it. The real estate for that column could be better used for something else.

4)I see both rep squares and post count stars are both gone. Looks better that way.

5)Clicking the New button used to take me to the first new post that followed the last one I made. It currently does nothing. I liked that feature and used it a lot. Hope you will restore it.

6) Hidden Quotes -- nice feature.

7) What is Permalink ???

lllllIllIlllI commented: I liked that button tooo :( +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Look in the boost libraries, I think it has an xml parser.

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

Maybe this will help int *remain[] = {remain1,remain2,remain3,remain4};

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

LIne 23: subkey can not be "" or NULL. You want to put key1 there.

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

When entering integers the '\n' (Return key) is left in the keyboard buffer. You need to clear that and all other characters out before calling getline(). See this thread for instructions how to do that.

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

NULL is used for pointers, not integers. Just call vector's resize() method if you want to have a 10x10 matrix of integers, and you have to resize() each row of the vector individually in a loop. The resize() method will set the values to 0.

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

i think it shoud end with \0 or nothing is required over there

Not necessary -- the compiler will generate the '\0' null terminator. But the { and } characters are unnecessary.

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

VC++ also has intellsense. I've found that the -> sometimes has problems and does not show the list of items that you might expect it to. There are intellsense options in menu Tools --> Options, but its turned on by default.

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

"aligned" is the key word -- what alignment? Not all compilers use the same alignment factor, and some compilers have options to change the alignment. Microsoft compilers have a #pack paragma what lets you align different parts of the program with different alignment factors.

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

I'm a rank amateur in terms of databases but overall it looks to me like you are trying to compile MFC code with the express edition which does not come with that feature.

You are right -- CRecordset is not supported by the Express edition.

@slowlearner: Create your own c++ class or a structure to contain the data for a single row of the resultset. Then use ODBC calls to iterate through the resultset rows.

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

You have several choices
1) open a pipe to the ls command
2) redirect the output of ls to a file, then open and read the file
3) generate the result yourself by using opendir() and readdir() standard C POSIX functions.

But you will most likely want to create an array of strings because ls might generate a lot of filenames.

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

The code you posted makes no sense all with the error messages. Post the code that correspoinds to the error messages.

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

So i will use something like CALLBACK WaitCommEvent()?

Yes you can use that, but put it in another thread so that it doesn't block the main program.