I want to creat a program in c++

I am trying to create a small replica of bank but with little difference, I want to first input 5 or more names that can be saved on different locations, but there should be a separate account for each member, i.e each member could access all of the available options separately like 1.deposit amount, 2.check balance, 3.withdraw amount and very important 4.return to main menu where member are requested to enter there name and account number... and this loop is annoying me it just is not happening from me...every time i get some sort of error like code unreachable or at the o/p screen it just looped with all options and does not stop.....

please help me with some flow chart can any one please..
Is this on command prompt? Are you wanting the ability to save data (i.e. the balance of each account #)? Inside your loop do you have some kind of input where the program stops and waits for input before continuing on?

1
2
3
4
5
6
7
bool quit = false;
do
{
   cout menu choices
   cin choice // program stops and waits here for user to enter in something
   call function depending on choice made
} while (!quit);
Last edited on
CODE IS DELETED
Last edited on
There are a lot of things that are wrong. You need to try out smaller things before taking on this project. Test each little thing you have learned and play around with arrays and functions in much smaller programs. That will help.
Please help any one i could not get what is wrong in this

You are using a compiler that is AT LEAST 5 years old. I won't say one word about the algforithm itself untill you fix that!!!
ok thnx...I just want some sort of flow chart (IF YOU CAN) which could help me in writing the new one that's it and i dont want any one to correct my code....just a sample flow chart of these types of programming......
FIRST throw your old compiler and/or IDE to thrash and never loo kback, and get a new frech compiler that is actualy from this decade please, OK?
Last edited on
No i want to run it on the old one.........and thnx any ways.....and srry If I bothered some one..
GET A NEW COMPILER!! Yours is obviously more than 5 years old, and you've got to upgrade it! If it came with the IDE, upgrade it too! You can't work with a compiler that old!!!
Last edited on
hey viliml i just can not get a substitute of clrscr().....and therefor i am using that old one....so is there any substitute available for clrscr()????
clrscr() is non-standard. Here is a big article all about it.

http://www.cplusplus.com/articles/4z18T05o/
Try CodeBlocks or Dev-C++. These are modern IDE's that will help you to complete your project in very less time. You don't have to worry about setting compilers or debuggers as these get installed automatically.

@Raman009: Dev-C++ and modern IDE in the same sentence without a 'not'? Really... Dev-C++ is old, and deprecated. I HOPE you meant Owrell Dev-C++, which is much MUCH MUUUUCH(!!!!) better.
srry ..my mistake..I guess the OP should go for CodeBlocks then..thanks @viliml
NO!
I wrote:
Owrell Dev-C++
Should I uninstall Codeblocks and go for Owrell Dev-C++? I had some problems with code blocks using <string> header. It doesn't recognize functions defined within <string>
Given that they both use the same compiler, it doesn't seem like a good solution. Give us an example of the code that has this <string> problem and we'll tell you what's wring with it.
main.c
1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
#include <string.h>

int main()
{
    char fn[6] = "Raman";
    strcat(fn," Ghai");
    printf("%s",fn);
    return 0;
}

It works !!

main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string fn = "Raman";
    string ln = "Ghai";
    string fullname = fn.strcat(ln);
    cout << fullname ;
    return 0;
}

It doesn't work

Is the header file <string> in C++ different from <string.h> in C ?
Is the header file <string> in C++ different from <string.h> in C ?


Yes. The <string> header file contains the C++ string class. The <string.h> header file contains functions useful for dealing with arrays of char.

fn.strcat(ln);
You are trying to use a string member function that does not exist. Here is the string class:
http://www.cplusplus.com/reference/string/string/
You will see that the string class has no member function named strcat.

Here is the strcat function:
http://www.cplusplus.com/reference/clibrary/cstring/strcat/
You will see that it is used completely differently to how you're trying to use it, and that it doesn't work on proper C++ strings.
thanks @Moschops I have been doing it completely wrong but now I won't.
Topic archived. No new replies allowed.