~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

In Rome, do the way Romans do...

If someone wants you to do a project in WinAPI, you got no choice but to do in WinAPI or leave the project. It all depends on the client requirement because its the business requirement which drives the software development arena.

It is actually a good thing to have different proficiencies under your belt. The more the better...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How about something like this:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
  string line;
  ifstream myfile ("example.txt");
  if (myfile.is_open())
  {
    while (myfile.good() )
    {
      getline (myfile,line);
      cout << line << endl;
    }
    myfile.close();
  }

  else cout << "Unable to open file"; 

  return 0;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

People are a burden, we can't stand and watch as the world around crumbles against the armys' march.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Brain juice is

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The future surely

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Powerslave - Iron Maiden

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

hearty

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Sneaky slippers of France inhale maladorous perfume while becoming famous scientists.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

you - girl

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The best thing you can do is to create a blank project or if your project already contains the stdafx files, copy the header information from them into your main file and delete them.

Since I don't have a MS Compiler with me right now, I can't verify the fact but you are good to go by writing your programs without those files, the way normal people do.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Something like this ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You can do something like that in Managed C++ though it is not something a beginner should try out. But still here it goes...

The same can be achieved using a third party library. Read this.

Mind you, both the approaches are pretty daunting...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The expression you just posted is an infinite expression.

My understanding would be that continue till the limit of your data type is reached. When double is used for factorial computations, the limit is 170. Take a look at this:

#include <iostream>
#include <cmath>

double factorial (double value)
{
    double result = 1.0;
    while (fabs (value) > 0)
    {
        result *= value--;
    }
    return result;
}

int main ()
{
    using namespace std;

    double E = 1.0;

    for (long i = 1; i <= 170; ++i)
    {
        double temp = factorial ((double)i);
        cout << "\nFactorial " << i << ": " << temp;
        E += (1.0 / temp);
    }
    cout << "\n\nThe value of E (approx.) = " << E;

    getchar ();
    return 0;
}

But practically it makes no sense to continue beyond the factorial of 8 since the answer remains more or less the same.

If using the value of e in some scientific calculation, it would make more sense to keep it as a constant value rather than calculating it.

const double E =  2.71828182845904523536028747135266249775724709369995
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe you need to read a bit harder because the links to the compiler are already there.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Arun, you need to properly format your code. Something like this:

void read_data()
{
    int i,j,any;
    char yesno;
    char fname[15];
    FILE *fp;
    clrscr();
    gotoxy(10,10);
    printf("Data available in disk file Y/N ");
    scanf("%c", &yesno);
    if(toupper(yesno)=='Y')
    {
        clrscr();
        gotoxy(10,10);
        printf("File name to read data ");
        scanf("%s",fname);
        fp=fopen(fname,"r");
        clrscr();
        fscanf(fp,"%d",&any);
        for(i=1;i<=n;i++)
            for(j=1;j=n;j++)
            {
                fscanf(fp,"%d",&any);
                x[i] [j]=any;
            }
    }
    else
    {
        clrscr();
        gotoxy(10,3);
        printf("Size of the matrix");
        scanf("%d",&n);
        printf("\nEnter the matrix\n");
        for(i=1;i<=n;i++)
            for(j=1;j<=n;j++)
            {
                scanf("%d",&any);
                x[i][j]=any;
            }
        clrscr();
        gotoxy(10,10);
        getchar();
        printf("Store data in disk file Y/N");
        scanf("%c",&yesno);
        if(toupper(yesno)=='Y')
        {
            gotoxy(10,12);
            printf("File name to store data");
            scanf("%s",fname);
            fp=fopen(fname,"w");
            fprintf(fp,"%3d",n);
            for(i=1;i<=n;i++)
            {
                fprintf(fp,"\n");
                
                for(j=1;j<=n;j++)
                    fprintf(fp,"%5d",x[i][j]);
            }
        }
    }
    for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
            y[i][j];
}

Now compare the code posted by me with the code you posted. Isn't the difference obvious ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Mister joeprogrammer, I must say I'm surprise not to agreed with you. I am an aspirant to be a 1/8 - decent programmer and I was able to see that the code was a sorting loop. I believe you were very conservative.

Aia, Joey is right, that thing is far from a simple sort. The reasons being:

• The missing braces after the if condition.

if(x[i]<x[j])  // a god knows what thing
    k=x[i];
    x[i]=x[j];
    x[j]=k;

// IS NOT EQUAL TO

if(x[i]<x[j])  // a swap block
{
    k=x[i];
    x[i]=x[j];
    x[j]=k;
}

• Not only that, assuming that the array has 10 elements, the code is subject to accesing memory which doesn't belong to you i.e. buffer overflow, since when i = 9 the variable j becomes 10 which is an invalid or out of bounds array index.

Hope this has made things a bit clear for you.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

complex sentence - whoa

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

scurry

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

My chemical - Finger Eleven

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

flurry

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Sneaky snakes of France inhale ancient perfume while becoming famous scientists.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Go, go where you want, anchor your roots underneath, doubt your doubts and believe your beliefs.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The ghost of Tom Joad - Rage Against the Machine

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

things you are

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

fast complex country music - too long sentence ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You get fish curry.

I put in codliver oil.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

string getFileName();
void appendData( ofstream&, int, int );

int main(int argc, char *argv[])
{
    ofstream fout;
    // declare other variables
    
    int fun1 = 2;
    int fun2 = 45;
    
    
    
    // open output filestream for appending
    // get valid file name
    ofstream fout( getOutFileName().c_str() );

Now you know why...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What you want to know ?

Sorting can be as simple as bubble sort. A detailed description of that can be found here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Either he found the solution to his own problem or he is referring to Java's super class... ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe this and this should get you going well.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

tumor attached to

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

think over it

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Friend in need is a friend indeed.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A place for my head - Linkin Park

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

scurried

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Route66 - highway to hell

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You get a Mod who agrees with you... ;)

I put in some a dagger.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Crafty spies of France inhale ancient perfume while stalking famous scientists.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hmmmm so that's what you do...

Hush..I guess you forgot that Davey can infract you...:mrgreen:

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

but it should

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

a kind of

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Crafty spies of Egypt inhale ancient dust while stalking famous scientists.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

hurried

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A rush of blood to the head - Chevelle

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hit the innocent, love the guilty, what kind of system is this...?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

G4 - P4

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Some related to the all favourite tech support...

Tech support: Okay Bob, let's press the control and escape keys at the same time. That brings up a task list in the middle of the screen. Now type the letter "P" to bring up the Program Manager"
Customer: I don't have a P.
Tech support: On your keyboard, Bob.
Customer: What do you mean?
Tech support: "P".....on your keyboard, Bob.
Customer: I'M NOT GOING TO DO THAT!

A woman customer called the Canon help desk with a problem with her printer.
Tech support: Are you running it under windows?
Customer: "No, my desk is next to the door, but that is a good point. The man sitting in the cubicle next to me is under a window, and his printer is working fine."

Tech support: How may I help you?
Customer: I'm writing my first e-mail.
Tech support: OK, and what seems to be the problem?
Customer: Well, I have the letter 'a' in the address, but how do I get the circle around it?

Tech support: What anti-virus program do you use?
Customer: Netscape.
Tech support: That's not an anti-virus program.
Customer : Oh, sorry...Internet Explorer.

Customer: Hi, good afternoon, this is Martha, I can't print. Every time I try, it says 'Can't find printer'. I've even lifted the printer and placed it in front of the monitor, but the computer still says he can't find it...

Tech support: Good day. How may I help you?
Male customer: Hello... I …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Why not get a new compiler which supports standard C++ and move with the world ?

And like I told you before, you need not use strcmp if all you are doing is comparing characters.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

eaten for days

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

so don't mind