WolfPack 491 Posting Virtuoso Team Colleague

Asking where the problem is not a question in C++.
You have to explain what the problem is, and then we will tell you where it is.

One problem in your code is this loop.

while (!infile.eof() && (count <=50))
{
         infile>>names[count]>>scores[count];
         count++;
         sum+=scores[count];
}

For some reason that is usually in every C++ FAQ, do not use the .eof() function for end of file testing.
Change it to

while ((infile>>names[count]>>scores[count])&& (count <50))
{
         sum+=scores[count];
         count++;
}

That should correct the problem of incorrect calculation of the average.

For 2 and 3, you should use loops to iterate through all the values in the array, instead of just using scores[50].

Something like

for ( int i = 0 ; i < count; i++ )
{
             if (scores[i ]<avrg)
                     cout<<names[i] << endl;
}
WolfPack 491 Posting Virtuoso Team Colleague

1. post more.
2. get reputation more.
3. live longer.

Jx_Man commented: thx for answer +1
Aia commented: ...Or don't piss off any one else. ;) +5
WolfPack 491 Posting Virtuoso Team Colleague

A trigger event is something that you can use to get a notification from the library when a particular even occurs. For example, you can get a notification when new data has arrived in the buffer by using the trigger event for data reception.

Read Triggers and trigger handles under Chapter 2 of the reference guide.

WolfPack 491 Posting Virtuoso Team Colleague

Here is the minimal code for a dialog box with a single push button. When experimenting it is always best to experiment with the least possible code.

#include <windows.h>
#define ID_1 4001

IDD_DIALOG1 DIALOGEX 0, 0, 206, 126
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
    WS_SYSMENU
CAPTION "calc"
FONT 8, "MS Sans Serif"
BEGIN
	PUSHBUTTON "1",ID_1,30,30,10,10
END

Add the menus after getting a window with a single button, or a windows without any buttons to execute.

WolfPack 491 Posting Virtuoso Team Colleague

From what I see, you are trying to create the pushbutton inside a menu. Is that what you are trying to do? If so, I don't think you can do that.

In any case, there is nothing wrong with the pushbutton line.

WolfPack 491 Posting Virtuoso Team Colleague

Documentation is not written by the developers for fun you know. Unless you are using fairly well known, well established APIs like the Windows API, the chances that someone who has used the library that you are using reads this post is fairly low. So when you are using a third party library, remember that there is no better help than the documentation provided with it.

In this particular case, you can use functions like GetBlock or GetChar to receive data from the buffer.

invisal commented: I agree +3
WolfPack 491 Posting Virtuoso Team Colleague

If you have no previous knowledge of C++ the best thing will be to start by learning C++. The link has information about editors and compilers needed to write, compile and execute C++ programs. Do you at least know C?

WolfPack 491 Posting Virtuoso Team Colleague

Well, you could do that programmatically, but you will need administrative priviledges for that. Wouldn't it be easier to let the user unblock the application by his own accord? After all it is his computer, and it only takes one click of a button.

Sulley's Boo commented: riiiiiiiiiiight! Happy new year Wolfiiiiiii! :cool: +4
WolfPack 491 Posting Virtuoso Team Colleague

What seems to be the problem?


And next time, do not attach the code as files. Usually it is an extra trouble for us to download it and open them seperately. We would prefer it included with the post so we can look at it directly. I have done it for now since it is your first time. I have also used code tags, so next time remember that when you are posting code.

WolfPack 491 Posting Virtuoso Team Colleague

The timezone information resides in the registry location of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones .

Use the API functions for accessing the windows registry to read that information.

WolfPack 491 Posting Virtuoso Team Colleague

You can't.

WolfPack 491 Posting Virtuoso Team Colleague

Didn't you read the links properly?

6.1 Link From Within the Visual Studio IDE

Starting with the header-only example project we created earlier:

1. Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu
2. In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_34_1\lib\.
3. From the Build menu, select Build Solution.

WolfPack 491 Posting Virtuoso Team Colleague

Use isspace for a check like this.

for(int i = 0; i < iLength; i++)
{
         if(!isspace(strTemp.at(i)))
         {
                  iSpace++;
         }
}
WolfPack 491 Posting Virtuoso Team Colleague

If including sstream doesn't give an error, but using std::stringstream does, then something else is wrong. What is the compile error? And what is the compiler you are using?

WolfPack 491 Posting Virtuoso Team Colleague

have you included the header file? #include <sstream>

WolfPack 491 Posting Virtuoso Team Colleague

Did you see my code snippet? Why can't you use that?

WolfPack 491 Posting Virtuoso Team Colleague

Something like this will be easy. There are more compilicated methods if you want to break Japanese or Chinese words. Also you can use a callback function to count the words on the fly, but I think this is the most simple way.

#include <string>
#include <sstream>

// Get the line from the Rich Edit Control .
// Let's hard code it for this example.
	std::string line = "In    that         case   this   sentence    has 27 words.\r\nThis is another line";
	std::stringstream ss(line);
	std::string word;
	int count = 0;

	while ( ss >> word ){
		std::cout << word << std::endl;
		count++ ;
	}
	std::cout << count << std::endl;
iamthwee commented: I approve. +13
Sulley's Boo commented: me too =D +3
WolfPack 491 Posting Virtuoso Team Colleague

How to use user32.dll in Dev-C++?

You give the path of the dll to the library path of DevC++.

Where to find User32.lib ?

I believe you will have to install the Microsoft Windows Platform SDK to have access those libraries.

WolfPack 491 Posting Virtuoso Team Colleague

Use the GetVolumeInformation Function. The Label can be obtained by the LPTSTR lpVolumeNameBuffer parameter.

WolfPack 491 Posting Virtuoso Team Colleague

Then it maybe a function provided by a custom made library. Don't you have at least the definition of that function? Usually the header file must have some kind of comment about the function.

WolfPack 491 Posting Virtuoso Team Colleague

Lookup the documentation of the read function.
We can only guess that
conf_fd may be a destination data buffer
conf maybe the source data buffer
100 is the number of bytes of data that should be read from conf to conf_fd.

WolfPack 491 Posting Virtuoso Team Colleague

I have forgotten all my Java, so the code may give you compile errors and you will have to fix them on your own. However the algorithm will be the same

Try a loop like this.

int x,y; \* Make these integers */
System.out.println("Enter a positive integer: ");
x=Interger.parseInt(input.readLine()); \* Get the user input to x. Used ParseInt to read it from the console. */

if ( x > 0) 
{
	for(y=-x+1;y<x;y++ )/* See the limits used for the loop.*/  
	{ 
        int i ; 
        for (  i = 0; i <= Math.abs(y) ; i++ ){
		System.out.println( i+1 );         
	}
        System.out.println( '\n' );  /* You need a newline at the end of the loop or you will get everything in one line */
	}
}

I guess the above should work. At least the algorithm should.

~s.o.s~ commented: Huh? A wolf in Java land! ;-) +20
WolfPack 491 Posting Virtuoso Team Colleague

C++ does not give you a method out of the box for multithreading like Java does.
To use multithreading, you will have to use the thread libraries offered by the operating system. For win32 you will have to use CreateThread and in unix you will have to use pthread_create .
I think the boost package offers portable ways of creating code that uses threads.

Jishnu commented: Nice one.. Helped me too :) +2
Haranadh commented: Nice point. thanks to refer boost lib info also. +1
WolfPack 491 Posting Virtuoso Team Colleague

You have missed a opening bracket in line 102. else newBal = ((balanceline - minimumPayment) * APR) + lateFee;

WolfPack 491 Posting Virtuoso Team Colleague

What Language is that?

WolfPack 491 Posting Virtuoso Team Colleague

line 21 and line 22 are wrong.
First implement the function getmeters.
Indentation of the code is horrible. Write the getmeters function and repost code.

WolfPack 491 Posting Virtuoso Team Colleague

Go through step 3 of this link.

WolfPack 491 Posting Virtuoso Team Colleague

Check line 7 if h+= b % 10; Next time post the error messages. That would help us to help you.

WolfPack 491 Posting Virtuoso Team Colleague

Ever heard of Google?

WolfPack 491 Posting Virtuoso Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague

Is it true that England holds a cricket match when they are in a great need for rain?

WolfPack 491 Posting Virtuoso Team Colleague

The usual reason is that you are not including the library that provides the implementation of pthread_create() . Check the documentation for pthread_create() and find out the required library. Then check if that library is in the makefile's libraries section.

WolfPack 491 Posting Virtuoso Team Colleague

I like oval.

WolfPack 491 Posting Virtuoso Team Colleague

I am assuming that you are creating a simple executable project, and not a dll project. Also I am assuming that you don't need any additional files, which is the case for simple projects.

When you build your project, depending on your Build Options (Debug/Resource) it creates an exe file inside the Debug or Resource folder. You can copy this file to anywhere you want, and it will execute when double clicked. If it is a console application, you may want to add a cin.get(); statement at the end of the program to keep the console window open until you hit enter.

WolfPack 491 Posting Virtuoso Team Colleague

What do you mean by "make C++ compiler".
I hope for your sake that you are not going to write your own C++ compiler.
So assuming that you want a C++ compiler that works under Linux and Windows,
Windows -Visual C++, DevC++ (google and you will find links to download these )
Linux - GCC ( comes with many linux distributions )

WolfPack 491 Posting Virtuoso Team Colleague
ee.f(eel)

This line passes the object eel into function f by value. So f creates a copy of eel inside it. The constructor used here is a seperate constructor called the copy constructor. Because you have to defined it, C++ uses an implicitly defined default copy constructor and nothing is displayed. But underneath the scenes, this default copy constructor is called.

Define the class as below and see the output.

class e
{

public:
    e()
        {
                cout<<"Contructor\n";
        }
    e(e &e_instance)
        {
                cout<<"copy Contructor\n";
        }

    ~e()
        {
                cout<<"Destructor\n";
        }
    void f(e e1)
        {
                cout<<"In e\n";
        }
};
WolfPack 491 Posting Virtuoso Team Colleague

1. Define the < operator for the student class and add the objects to a std::list.
2. Call the sort function of std::list and the list will be sorted.
3. Use std::cout to prompt the user, and std::cin to read the user input.

WolfPack 491 Posting Virtuoso Team Colleague

May be nothing, but this is what I see when I open the top link of this google search result in Firefox 2.0.0.6 on Windows Server 2003 Remote Desktop Login. Didn't see it by entering the link directly from the browser address box.

Dani commented: Thanks for the catch. +10
WolfPack 491 Posting Virtuoso Team Colleague

Problem? What problem?

WolfPack 491 Posting Virtuoso Team Colleague

Does it compile and run?
Read the documentation of printf, and you will understand if it is a valid program or not.

WolfPack 491 Posting Virtuoso Team Colleague

All data are stored as binary. You can only change how it is displayed. If you only want to print the data as decimal, just use normal cout. If not, explain what you want to do with an example input and corresponding output.

WolfPack 491 Posting Virtuoso Team Colleague

You are using the Visual C++ IDE.
You have created a "Win32 Project".
You should be creating a "Win32 Console Application" project.
To solve this problem, create a new "Win32 Console Application" and add the rbf.cpp source file to the new project and compile. Should work.

WolfPack 491 Posting Virtuoso Team Colleague

The error messages are supposed to tell you what the errors are. Learn to read and correct them yourself.
When you are writing programs, do not write the whole program at once, and then try your luck with the compilation. The correct way is to write and compile, function by function, or better block by block, and if possible line by line.

If you use a good code editor with syntax highlighting, rather than something like notepad, or at least if you had some kind of consideration to use code tags when dumping the code here, you would have seen that the syntax highlighting is messed up from line 38 and downwards. This maybe the result of some kind of delimiter that is missing in the code. Looking closely just above line 38, because that is where the incorrect syntax highlighting begins to show, we see that a double quotation mark " is missing at the end of line 37. Try adding it and compiling again. Maybe that is the only error. If you comeup with other errors, do post them when you reply again. And use code tags.

WolfPack 491 Posting Virtuoso Team Colleague

Tell me the actual version (Year and Month)of this MSDN Library that you have installed. Did you install it when the VC++ installation prompted you to provide the MSDN disks, or was the MSDN library installation done seperately?

WolfPack 491 Posting Virtuoso Team Colleague

User notes are administrative notes about a particular user that can be updated and read by any administrative staff member. These maybe helpful to the same or another administrative staff member when making decisions regarding that user at a later time

Sulley's Boo commented: :D +3
WolfPack 491 Posting Virtuoso Team Colleague

Ah. Just noticed that my suggestion has been implemented. Thank you Dani! :)

WolfPack 491 Posting Virtuoso Team Colleague

Yes. A Hello World Dialog box pops up when you hover the mouse over this thread listing the the Feedback forum page.

WolfPack 491 Posting Virtuoso Team Colleague

First of all I am not familiar with the EFS structure.
Is the header encrypted or not?
If the header is not encrypted, then reading it is the same as reading normal files. Look up for code that reads a bitmap file and extracts the header and image contents. It should be similar.

If the header in encrypted too, then you should decrypt it before trying anything else.

WolfPack 491 Posting Virtuoso Team Colleague

You haven't asked a question for us to answer.
And for your information it isn't "Daubly Linked List" but "Doubly Linked List"

WolfPack 491 Posting Virtuoso Team Colleague

Get the return value of GetPixel and RGB functions to seperate variables. See if the values are infact what you expect, rather than just comparing them.

Also read the remarks section of the GetPixel documentation.

iamthwee commented: c o r r e c t . +12