K
kudruu
Hello,
I am having a problem in Microsoft Visual C++ with some code I have
written (I am a bit of a novice so I appologize if this is a very
mundane problem).
This is a segment from one of the functions I am using. I am trying
to get a user to input whether they want an output file or not and if
they do to specify the name. Output_File is a global char.
Maybe there is a better way to do this, nonetheless, it compiles with
a LNK4075 warning.
When I run the code, however, it allows me to enter the if statement
and type my preference. Then it doesn't even advance to the next
print statement (in or outside of the if), it quits with the message:
Here is the problem code:
char Yes_No[1];
printf("Do you wish to write an output file (y/n)? ");
if (gets(Yes_No) == "y"){
printf("\nPlease input the desired name of your file: ");
scanf("%s",&Output_File);
}
I am having a problem in Microsoft Visual C++ with some code I have
written (I am a bit of a novice so I appologize if this is a very
mundane problem).
This is a segment from one of the functions I am using. I am trying
to get a user to input whether they want an output file or not and if
they do to specify the name. Output_File is a global char.
Maybe there is a better way to do this, nonetheless, it compiles with
a LNK4075 warning.
When I run the code, however, it allows me to enter the if statement
and type my preference. Then it doesn't even advance to the next
print statement (in or outside of the if), it quits with the message:
Code:
Debug Assertion Failed!
File: fopen.c
Line: 55
Expression: *file != _T("\0')
Here is the problem code:
char Yes_No[1];
printf("Do you wish to write an output file (y/n)? ");
if (gets(Yes_No) == "y"){
printf("\nPlease input the desired name of your file: ");
scanf("%s",&Output_File);
}