المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Need Help Debugging Program



C++ Programming
05-23-2009, 01:10 AM
I have Visual Studio 2005. I'm doing some console programming and developing a virtual computer store. I have a few problems.

1.) Why do I get these warnings?
Warning 1 warning C4996: 'strcat' was declared deprecated f:\testing\testing\testing.cpp 22
Warning 2 warning C4996: 'strcpy' was declared deprecated f:\testing\testing\testing.cpp 26

2.) You have to enter a password in the beginning of the program in order to access the store. I have it set up so that it tells the user that the password is incorrect. It used to display that if the user did indeed put in the wrong password but it would still let the user move onto the store. So to stop that, I added the line "return 0;" in the else condition. The problem is that it now exits out of the program without even letting the user see that the password was incorrect. What would be a better solution?

3.) I've noticed that in the first question if my if condition is true, it still moves onto my switch method question. I want it to stop.

Here is my code:

#include "stdafx.h"
#include "iostream"

using namespace std;

int main(){

char Password[50];
int a;
int b;
int c;
int d;

cout d;

switch (d){

case 1:
cout