WolfPack 491 Posting Virtuoso Team Colleague

Okay then I assume you have the DLL with you. So you should have the documentation of that DLL also. That is you must know the functions available, what the functions do, and what are the parameters the functions need to execute properly. After looking up for those in the documentation you can refer this site, which is an example on How to call the

myPuts

function in the

Myputs DLL

. I think it is fairly straightforward, but you can ask if you run into further problems.

I must also say that I appreciate what you are doing to help those kids with speech problems.

WolfPack 491 Posting Virtuoso Team Colleague

well this method is not to be followed
to delete large files or folders at once
u can delete it within sec.

just create another file/folder with the same name which u want to delete.

I don't think you can create a file or folder with the same name in the same directory. At least not in windows.

WolfPack 491 Posting Virtuoso Team Colleague

f1 for help
f3 for rename
f5 for refresh

I think you mean

f2 for rename
f3 for search
WolfPack 491 Posting Virtuoso Team Colleague

Ok..
I'm Sorry.
BUt same may be applied to u also :cheesy: :cheesy:

Yeah we poor lowdown worthless critters. :cry:

WolfPack 491 Posting Virtuoso Team Colleague

Didn't understand that...??? SUNNYPALSINGH

I think it means he doesn't come here to read your posts. :evil: :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

Those are C Codes alright. But for the solaris environment. Here is a more generic implementation, taken from Narue's homepage.

WolfPack 491 Posting Virtuoso Team Colleague

Maybe this should help. Not sure though.

WolfPack 491 Posting Virtuoso Team Colleague

I mean compiling it, this is what I get:

****************************************************

         Please wait...

         The following file tolldata.txt has been found.

        ****************************************************


        Error - Invalid or miss match Station ID record.
        Please refer to line 6 of tolldata.txt text file.

Press any key to continue . . .

Bench is right. You are reading past the EOF. And it is not compiling. You are executing ( running ) the program. This is a runtime error.

WolfPack 491 Posting Virtuoso Team Colleague

What is the error message? What is line number 6? We can't go on counting you know...When you say execute do you mean compiling or running the program?

WolfPack 491 Posting Virtuoso Team Colleague

how would I go about in fixing that problem by not having to open the same file again?

To pass the ifstream from main() do i need to have my code to something like??

int checkfile(int & Record, &openfile)
{
}

Yes you could do that or shift the file checking message also in to the CheckFile Function.

int Checkfile(int & Record)
{
     ifstream openfile ( "tolldata.txt" ); //Declare Input File stream as openfile
    if (openfile.is_open())/*If text file is open excute the following*/
       {
              cout << "\t****************************************************\n\n";
              cout << "\t Please wait...\n\n" << 
              "\t The following file tolldata.txt has been found.\n\n";
              cout << "\t****************************************************\n\n";
       }
       else /*If text file doesn't exist display message and terminate program*/
           {
              cout << "\t****************************************************\n\n";
              cout << "\tError - Opening tolldata.txt file has fail.\n";
              cout << "\tThe program will now terminate.\n\n";
              cout << "\t****************************************************\n\n";
              exit(1);
           }

                                        //then open the call marks.txt file
    while (!openfile.eof() && Record < ArrayRecord && !openfile.fail())
     {  
         //While loop, As long as the statement not equal to end of file,
         //record is lesser then ArrayRecord, and opening file does not fail
         //Then perform the following.
          
          openfile >> CustID[Record]; 
                                         //Open marks.txt file and store into
                                         //StudentID[Record] Array.
                                         
    if (CustID[Record] < 0 || openfile.fail())
        /*If StudentID[Record] is greater then 999999 or lesser then 0
        or record file fail to open, prompt user with error message
        and error line.*/
       {                        
          cout << "\n\tError - Invalid or miss match Customer ID record.\n"; 
          cout << "\tPlease refer to line " << Record +1 …
WolfPack 491 Posting Virtuoso Team Colleague

Thank you for your respond.

If I was to use && wouldn't that only work if all the information contain in the text file as to be a, b, c, and d for the if statement to run?

What if in the text file I was to have:

234323 c
343212 d
323432 e <=== only of these line that does not match.
763634 b

From what I remember the AND statement will only be true if the rest of the line is true. Correct me if I'm wrong.

I think my logic is correct. If you use ||, since 'B'!='a', you will get an error even if you input 'B'.
What dragon say is also correct, you are opening the file twice. You can correct them and check if my logic is correct or not.

WolfPack 491 Posting Virtuoso Team Colleague

I think it should be this.

if (
       (
            StationID[Record] != 'A' 
            && 
            StationID[Record] != 'a' 
            && 
            StationID[Record] != 'B' 
            && 
            StationID[Record] != 'b' 
            && 
            StationID[Record] != 'C' 
            && 
            StationID[Record] != 'c' 
            && 
            StationID[Record] != 'D' 
            && 
            StationID[Record] != 'd'
       )
       ||
       openfile.fail()
       )
WolfPack 491 Posting Virtuoso Team Colleague

So do you want a DLL that converts MP3 to and from Wav format?
Or Do you want to know how to call a DLL that you already have?

WolfPack 491 Posting Virtuoso Team Colleague

I Say ...who published my answer sheet. Hik Hik zzzzzzzzzzzzz.

WolfPack 491 Posting Virtuoso Team Colleague

Good to see that you are back Dave.

WolfPack 491 Posting Virtuoso Team Colleague

sen de mi brütüs!tum fatih universitesi burda olsa gerek!!!

Greek never was my strong subject.

WolfPack 491 Posting Virtuoso Team Colleague

You should try it yourself first.
First write the steps you would take, if you were to do it in real life. You can do it in a spoken language you are familar with.
After writing it, then try to convert it to C/C++.
If you try it yourself, and find you are stuck somewhere, post your attempts, and we will help if we are convinced that you deserve help.

WolfPack 491 Posting Virtuoso Team Colleague

Yes I know. So you have to store the numbers that have come up before and refrain from displaying them if they come up again. To do that

int Array [ 100 ] = { 0 };
int counter = 0;
int number;
while ( counter < 100 )
{
        number = rand()%100;
        if ( Array[ number ] == 0 )
        {
               printf ("%d\n", number);
               Array[ number ] = 1;
               counter++;
        }
}
WolfPack 491 Posting Virtuoso Team Colleague

Look for the

itoa

function.

WolfPack 491 Posting Virtuoso Team Colleague

What about this one? It is a small modification of your second program. It displays 99 or 100 numbers but there is no guarantee that all the numbers from 0 to 99 will be output.

//* Randomizing numbers…*//

#include <stdio.h>
#include <stdlib.h>

int main()
{
    srand( time(0));
    int i;

    for (i = 0; i < 100; i++) 
    {
        printf("%d\n",rand()%100);
    }
    return 0;
}
WolfPack 491 Posting Virtuoso Team Colleague

Have a look at this site. It is known as one of the best for introducing socket programming. Also it should work without any trouble in Linux with gcc.

Edit:
Both programs should be using the same port. One should be the server and the other should be the client.

WolfPack 491 Posting Virtuoso Team Colleague

Well unless you are reading and writing at the same time, there shouldn't be any problem.

That is if it cycles like

Process A - Write File
Process A - Close File
Process B - Read File
Process B - Close File
Repeat from above

There are mechanisms by the operating systems for processes to communicate with eachother. One of the easiest way is to use a socket. Make a connection between the processes through a socket and then write the data to the socket. The recieving process can then read from the socket when there is data available.

WolfPack 491 Posting Virtuoso Team Colleague

Regarding this incident, she is not abusing her power as a moderator when closing an old thread. But I see a very serious flaw in this banning system. How on earth does a message regarding a ban directed at one of the moderators goes to himself/herself? Bans should be confidential.

um I went through my own post just now. All these places where I have written ban... actually I meant flagging bad post. Sorry for any misunderstanding. I guess I was a bit ruffled。

WolfPack 491 Posting Virtuoso Team Colleague

Nothing seems to be wrong at first glance. Maybe there is a semicolon out of place in a header file or any other source file where DebugTest is declared. That is the most possible cause that comes to my mind...

WolfPack 491 Posting Virtuoso Team Colleague

Narue is an equal staff member on DaniWeb. The way that the flag bad post system currently works is that when a post is flagged, a ticket regarding the issue is created in a private area visible only to staff. This allows for such threads to be handled most efficiently since any staff member can deal with the thread and mark it solved. Staff should, in theory, handle moderation issues impartially. We are, however, all human.

Ethically no moderator should be allowed to make decisions on their own post when there is a conflict regarding it. /*edit. bad example*/When it is a moderator's post that is being flagged dont send the notification to him/her.

This is different than the reputation system! I agree, that no member or moderator should see who reputation came from.

The reason I think is that people tend to favour people who voted for them. Well the way I see it, making friends is better than fighting.

When one clicks on Flag Bad Post, on the other hand, there is a message indicating that: This is ONLY to be used to report spam, advertising messages, and problematic (harassment, fighting, or rude) posts. Clearly, you can see how it would be valuable for threads fitting this description to be brought to the attention of all staff so that they are handled as quickly as possible by whomever happens to be online at the time.

I see the point. But in cases like this it brings a …

WolfPack 491 Posting Virtuoso Team Colleague

Me too

WolfPack 491 Posting Virtuoso Team Colleague

What I am trying to say is FreeArsenel flagged a post from Narue. How come a bad flag notification went to her? If she didn't get that notification the other moderators would have looked into the matter and made a decision. Because of the notification, she knew who sent it, why it was sent...and therefore started this private war between the two. As an example, in this case because Narue is in the receiving end, I think the notification should have gone only to big_k105, BountyX, Dave Sinkula, Paladine, Stack Overflow, vegaseat Other than that red dot in the control panel of the message, nobody else should know about the details.

WolfPack 491 Posting Virtuoso Team Colleague

As a result of this and other incidences, Narue has decided to step down as moderator :( Despite her "tell it like it is" attitude, she is very knowledgeable and has been a great asset to our community. With that said, I don't want this to go any further.

Oh come on. Now who is being childish? In my opinion she is the most knowledgable person in this forum, and it is mostly because of her that reading the answers in the C/C++ forum is worthwhile.
After all she should know that responses like this is part of parcel with speaking what she thinks is write.. If she has confidence on what she did was right why should she step down? She is the only moderator in the C/C++ forum that takes time to give answers at present. Dave was here when I joined the forum but recently I have seen no sign of him. If Narue also goes what will happen?

Regarding this incident, she is not abusing her power as a moderator when closing an old thread. But I see a very serious flaw in this banning system. How on earth does a message regarding a ban directed at one of the moderators goes to himself/herself? Bans should be confidential. We don't know who adds reputation to us. So why can't you do the same for the reverse? In my opinion it should be the most confidential. You should redesign this notification system Dani. Let the …

WolfPack 491 Posting Virtuoso Team Colleague
if (StrokeCount == 5 )
{
			cout<< "You are on Par Way To Go!!"<<endl;
			cout << endl;

}
else
if (StrokeCount < 5)
		
			{
				Par = 5%StrokeCount;
				cout <<" You are "<< Par <<" under Par" << endl;
				cout << endl;
			}
			else
                if (StrokeCount > 5 ) 
			    {
					Par = StrokeCount%5;
				
				cout <<" You are "<< Par <<" over Par" << endl;	
				cout << endl;
}

You need the brackets. Also since you are checking above for StrokeCount == 5 and StrokeCount < 5 no need to check again for StrokeCount > 5. Just a simple else will do but I didnt change that since it works this way also. You can change it if you want.

What did I tell you about the Tabs and Spaces?It is difficult to read code like this. All the formatting is lost.

WolfPack 491 Posting Virtuoso Team Colleague

It is easy..

For each number from 2 to TheSpecificNumber
                    If number is a prime number
                                  Print number
                    Else
                                  Dont Print it
                    End if
          End For
WolfPack 491 Posting Virtuoso Team Colleague

What about now?

#include <iostream>
#include <ctime>
using namespace std;
int main()
{
    char Club =' ';
    char Choice =' ';
    srand(time(0));

    cout << " Would You Like To Play? Press [Y] to Continue [N] to Exit "<<endl;
    cin >> Choice;
    cout << endl;
    cout << endl;
    Choice = toupper(Choice);
    while ( Choice == 'Y')
    { 
        int StrokeCount = 0;
        int StrokeDistance = 0;
        int HoleDistance = 280;

        do
        {
            cout <<"You are " << HoleDistance <<" metres away from the Hole " << endl;
            cout << endl;
            cout << "Select Club [D]river [I]ron [P]utter :  " << endl;
            cin >> Club;
            cout << endl;
            Club = toupper(Club);
            switch (Club)
            {
            case 'D':  
                StrokeDistance = 80 + rand() % (120 - 80 + 1);
                StrokeCount = StrokeCount + 1;
                break;

            case 'I':   
                StrokeDistance = 24 + rand() % (36 - 24 + 1);
                StrokeCount = StrokeCount + 1;
                break;
    
            case 'P':	                  
                StrokeDistance = 8 + rand() % (12 - 8 + 1);
                StrokeCount = StrokeCount + 1;
                break;

            default: 	    
                StrokeCount = StrokeCount + 1;
                cout << " Air Swing 0 Metres Travelled "<<endl;
                cout << endl;
                break;
            }	
            if ( StrokeDistance > HoleDistance )
            {
                StrokeDistance = HoleDistance;
            }
            cout <<"The ball travelled " << StrokeDistance <<" metres "<< endl;
            HoleDistance = HoleDistance - StrokeDistance;
            cout << endl;
        }	
        while ( HoleDistance > 0 );

        HoleDistance = 0;
        cout <<" Congratulations the Ball is in the Hole!!! " << endl;	
        cout << endl;

        cout << " Would You Like …
WolfPack 491 Posting Virtuoso Team Colleague

Did you try compiling and running my code?

WolfPack 491 Posting Virtuoso Team Colleague

Nobody laughs at nobody's code. At least nobody who remembers that they were also new to this once.
What does this program do now?

#include <iostream>
#include <ctime>
using namespace std;
int main()

{
    char Club =' ';
    char Choice =' ';
    srand(time(0));

    cout << " Would You Like To Play? Press [Y] to Continue [N] to Exit "<<endl;
    cin >> Choice;
    cout << endl;
    cout << endl;
    Choice = toupper(Choice);
    while ( Choice == 'Y')
    { 
        int StrokeCount = 0;
        int StrokeDistance = 0;
        int HoleDistance = 280;

        do
        {
            cout <<"You are " << HoleDistance <<" metres away from the Hole " << endl;
            cout << endl;
            cout << "Select Club [D]river [I]ron [P]utter :  " << endl;
            cin >> Club;
            cout << endl;
            Club = toupper(Club);
            switch (Club)
            {
            case 'D':  
                StrokeDistance = 80 + rand() % (120 - 80 + 1);
                StrokeCount = StrokeCount + 1;
                break;

            case 'I':   
                StrokeDistance = 24 + rand() % (36 - 24 + 1);
                StrokeCount = StrokeCount + 1;
                break;
    
            case 'P':	                  
                StrokeDistance = 8 + rand() % (12 - 8 + 1);
                StrokeCount = StrokeCount + 1;
                break;

            default: 	    
                StrokeCount = StrokeCount + 1;
                cout << " Air Swing 0 Metres Travelled "<<endl;
                cout << endl;
                break;
            }	
            cout <<"The ball travelled " << StrokeDistance <<" metres "<< endl;
            if ( StrokeDistance > HoleDistance )
            {
                StrokeDistance = HoleDistance;
            }
            HoleDistance = HoleDistance - StrokeDistance;
            cout << endl;
        }	
        while ( HoleDistance > 0 );

        HoleDistance = …
WolfPack 491 Posting Virtuoso Team Colleague

If you look at the part called Similar Threads at the bottom of this webpage you will find a lot of threads with examples.

WolfPack 491 Posting Virtuoso Team Colleague

There really hasn't been any consistant downtime.

yeah. That maybe why I couldn't finish reading. :sad:

WolfPack 491 Posting Virtuoso Team Colleague

I'm in NY and the server is down in Texas

Looks like the butterfly effect to me. ;)
Glad the server is up anyway. I actually started reading a book during the downtime. :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

A ha ha, that would be like the blind leading the blind.

You are too modest. :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague
if(a.find == 1 , "$")

Is the syntax correct?

WolfPack 491 Posting Virtuoso Team Colleague

Hey but what I meant was that if u can understand in what context the thanks was said and I was refering to the thanks said on the achievement of attaining the solution..I thought u would understand..in what context I had said..:rolleyes: !! Any ways THANKS

I think what cscgal meant was that the word thanks is not a condition to decide whether or not to close a thread. After all you should have some way of automating the enforcement. Only people can understand context ( at least feasibly) and in this case it will be done by moderators. I think that it will be an extra load for the moderators. That said I must say that I am just stating my opinion, I dont know a thing about forum maintainence or moderating. Just a layman's way of thought.

WolfPack 491 Posting Virtuoso Team Colleague
144x[ { cosec( arctan( 2.4 ) }^2]
WolfPack 491 Posting Virtuoso Team Colleague

wat m tryin 2 say is that is ther no method for making people mark ther own problem solved threads as solved..sumthin compulsory

To make it compulsory you should have some kind of logic on informing the user to close the thread. How are you suggesting doing this? how can you decide when to close the thread?

WolfPack 491 Posting Virtuoso Team Colleague

I start reading from the end of the thread. So this problem does not occur to me. :cheesy: There is a very handy button that takes you right to the last post of the thread.

WolfPack 491 Posting Virtuoso Team Colleague

I couldn't access it all day today from where I work using IE6. Kept getting a strange error (I don't recall what it said). But at home using FireFox it was ok. Coincidence??

Around the time you posted ( 11 AM Japan Time ) I also could not access Daniweb using the IE7 browser. But it was okay in the firefox browser at the same time. Mustbe some browser related thing.

WolfPack 491 Posting Virtuoso Team Colleague

It is used to define the Complex Number Space. But I dont think calculations of it is that difficult. After the definition it is mostly algebra.

WolfPack 491 Posting Virtuoso Team Colleague

i is the root of -1.
Or more precisely i^2 = -1

WolfPack 491 Posting Virtuoso Team Colleague

There is a facility called google you know. Anyway refer this site.

WolfPack 491 Posting Virtuoso Team Colleague

Well what was the problem?

WolfPack 491 Posting Virtuoso Team Colleague

And I want to ask you one question that if I get a homework can you help me in solving it.

Yeah sure. But only if you prove that you have tried it yourself first.
We only give homework help to those who show effort

WolfPack 491 Posting Virtuoso Team Colleague
//---------------------------
// lab8.cpp
// Author: Grant Bivens
// Class: EET 2303 C++
// Professor: Dr. Imad Abouzahr
// Date: 4-4-06
// This program generates a table of values at specific times along a sine waveform.
//---------------------------

#include <stdio.h>
#include <stdlib.h>
#include <cmath>	// includes
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;		// using standards.
using std::endl;
using std::setw;
 
const float pi = 3.1415; //set pi as a constant so "pi" can be used instead of 3.141...

// initalize function CalcWaveform 
void CalcWaveform ( double Waveform, int size, double frequency, double deltat, double amplitude );
 
int main() //begin main function
{
   int wavesize; // initalize wavesize as integer
   double duration, deltat, amplitude, frequency; // initalized as double
 
   cout << "\nEnter duration"; // get duration
   cin >> duration;
 
   cout << "\nEnter Delta t"; // get delta t
   cin >> deltat;
 
   cout << "\nEnter wave amplitude"; // get amplitude
   cin >> amplitude;
 
   cout << "\nEnter wave frequency"; // get frequency
   cin >> frequency;
 
   wavesize = static_cast <int> ( duration / deltat ); //set size of wavesize
   double Waveform []; // initalize Waveform array
   for (int i = 0; i < wavesize; i++) //loop
   Waveform [ i ] = 0.0; // initalize array to 0
 
   // call function
   CalcWaveform (Waveform , wavesize, frequency, deltat, amplitude);
   cout << "\nTime" << setw ( 13 ) << "Sine" << endl; // display header text
 
   // loop to fill waveform array
   for ( int h = 0; h < wavesize; h++ ) 
   cout << setw ( …
WolfPack 491 Posting Virtuoso Team Colleague

Please post your solution here. Maybe someone else will find it usefull in the future.
Edit:
Better also if you gave the test arrays also.