I wanted you people's point of view on this project I made in C++ sometime back...I would be glad to recieve comments from anyone and everyone...Pls do check it out...So that I can know the quality of my project

I wanted you people's point of view on this project I made in C++ sometime back...I would be glad to recieve comments from anyone and everyone...Pls do check it out...So that I can know the quality of my project

It's just an exe. I'm happy to review your code, but I'm cautious when it comes to programs I can't be sure about.

Please don't take this the wrong way. It's not that I don't trust you, it's just that I don't trust anybody. ;)

Member Avatar for iamthwee

It's just an exe. I'm happy to review your code, but I'm cautious when it comes to programs I can't be sure about.

Please don't take this the wrong way. It's not that I don't trust you, it's just that I don't trust anybody. ;)

Yup, Post the code

And tell us what the program is supposed to do. Let us know what we're in for. :)

Agreed, it's pretty hard to give a "quality check" if we can't see the quality of your code...

And tell us what the program is supposed to do. Let us know what we're in for. :)

Agreed, it's pretty hard to give a "quality check" if we can't see the quality of your code...

When I wrote this I was pretty amature ( before having learned many things here ) so I am quite sure your going to find a million mistakes in there, anyway i am attaching the code which I compiled in TurboC++ compiler. Pls do have a look.

Member Avatar for iamthwee

Let me give you some constructive criticism.

1. Ditch turbo c if you are serious about c++, because you are so far away from actual c++ it is untrue.

2. Ditch all those crappy functions like goto(x,y) and clrscn because it makes your code unportable. In other words I can't compile and use it with my compiler.

3. There are many, many more errors regarding the semantics of the c++ programming language.

Let me give you some constructive criticism.

1. Ditch turbo c if you are serious about c++, because you are so far away from actual c++ it is untrue.

2. Ditch all those crappy functions like goto(x,y) and clrscn because it makes your code unportable. In other words I can't compile and use it with my compiler.

3. There are many, many more errors regarding the semantics of the c++ programming language.

I absolutely knew that was coming! :)
I have learnt a lot since then. I assume you would have been unable to compile the program( due to the high volume of errors with your compiler and lack of portability) . That was the sole reason for me attaching the .exe file at first.:) And I have ditched goto(x,y) , turbo, not clrscr()( i use system("cls") instead of that), and lot of other stuff.
I used a lot of graphics in this program. How tough is it to jump to VC++ ? And is it feasible to use system functions? ( like system("cls") )

most programmers frown on using system function for anything but quick-and-dirty little programs that you intend to give to no one. There are almost always C or C++ functions, possibly os api functions, that will do the same thing, often with a little more coding.

most programmers frown on using system function for anything but quick-and-dirty little programs that you intend to give to no one. There are almost always C or C++ functions, possibly os api functions, that will do the same thing, often with a little more coding.

Really? I was getting fond of system functions. What do u mean by OS api functions? Can u give me an example. Like for Dev C++, i m using the system("cls") command for clearing the console, what shud i use to replace that?

Member Avatar for iamthwee

Really? I was getting fond of system functions. What do u mean by OS api functions? Can u give me an example. Like for Dev C++, i m using the system("cls") command for clearing the console, what shud i use to replace that?

You rarely ever need to use clear screen.

In short don't use graphics in c++ or c. It sucks big time.

If you want a pretty GUI then use java or dot net.

You rarely ever need to use clear screen.

In short don't use graphics in c++ or c. It sucks big time.

If you want a pretty GUI then use java or dot net.

I agree wholly with u, graphics in C/C++ really suck but clearscreen is an often used function in C/C++. How can you do without it? When I make a menu, its impossible to work without clear screen:confused:

Member Avatar for iamthwee

I agree wholly with u, graphics in C/C++ really suck but clearscreen is an often used function in C/C++. How can you do without it? When I make a menu, its impossible to work without clear screen:confused:

Clearing the screen is completely OS dependant. That means it isn't guaranteed to work across different platforms.

For that reason I'm not going to tell you how to clear the screen efficiently on the windows platform, which I assume is what you are poking for.

What you should be doing, is not clearing the screen, but just appending the menu to the stuff that is already displayed in the command prompt/ console window.

Really? I was getting fond of system functions. What do u mean by OS api functions? Can u give me an example. Like for Dev C++, i m using the system("cls") command for clearing the console, what shud i use to replace that?

Lets say you want a list of all the files in a directory. One way to do that is system("dir *.txt > file.lst") which will put the list in a file named file.lst. Although that is convient because it doesn't require much coding, a much better way is to use os-api functions, such as win32 api function FindFirstFile() or *nix function opendir(). You will find examples of both these functions in the code snippets board. You will also find a lot of other nice-to-know stuff there also.

Seeing that you are ready to take in real knowledge and are inquisitive about it, I would recommend you read this. Posted by one of our moderators WaltP.

Seeing that you are ready to take in real knowledge and are inquisitive about it, I would recommend you read this. Posted by one of our moderators WaltP.

Thanx!

Really? I was getting fond of system functions. What do u mean by OS api functions? Can u give me an example. Like for Dev C++, i m using the system("cls") command for clearing the console, what shud i use to replace that?

Here's a link that describes many ways of clearing the screen and the advantages and disadvantages of each.
http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385

My favorite :cheesy:

OPTION 4
Throw the monitor out the window
Advantages:

  • Pretty fail-proof.
  • Releases your anger.

Disadvantages:

  • No more monitor.
  • It makes a mess.
  • Not portable (monitors are heavy).

Throw the monitor out the window

Never (yet) done that, but I've thrown a keyboard against the wall.
Advantage is that it prevents incorrect user input.

Here's a link that describes many ways of clearing the screen and the advantages and disadvantages of each.
http://www.cprogramming.com/faq/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385

After reading the various methods of clearing the screen, I guess there is not a single method which extends portability to the language:eek:
Or is there?

So I think there is no point in trying to use alternate methods to clear the screen when its always going to be paltform dependent.

#include <stdio.h>

#define SCREEN_HEIGHT 25

int main ( void )
{
  int i;
  
  for ( i = 0; i < SCREEN_HEIGHT; i++ )
    putchar ( '\n' );
    
  return 0;
}

I think this is a good method to avoid the system("cls") function since it is so much resource consuming but there are limitations regarding the size of the console and how do I make the cursor come back to the top of the screen from the bottom?

After reading the various methods of clearing the screen, I guess there is not a single method which extends portability to the language:eek:
Or is there?

So I think there is no point in trying to use alternate methods to clear the screen when its always going to be paltform dependent.

#include <stdio.h>

#define SCREEN_HEIGHT 25

int main ( void )
{
  int i;
  
  for ( i = 0; i < SCREEN_HEIGHT; i++ )
    putchar ( '\n' );
    
  return 0;
}

I think this is a good method to avoid the system("cls") function since it is so much resource consuming but there are limitations regarding the size of the console and how do I make the cursor come back to the top of the screen from the bottom?

Except I haven't used a 25-line screen in years. I'd change it to at least 100 ;)

Except I haven't used a 25-line screen in years. I'd change it to at least 100 ;)

UR rite:)
Actually I just copied the code right from the link and didn't bother to change the length since I was more concerned with the method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.