#include "stdafx.h"
usingnamespace std;
int m;
char holder[];
char writer(holder[m]); //
{
char holder[100];
for (int m=0 ; m < 100 ; m++)
{
}
ofstream file("biplav.txt");
if (file.is_open())
{
for (int m=0 ; m < 100 ; m++)
{
file << holder[m];
}
file.close();
}
else
{
cout << "Unable to open file" << endl;
}
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{cout << "what do you want to write? Limit within 100 character" << endl;
cin >> holder[m]
writer(holder[m])
cout << "You wrote" << holder[m] << end1;
// some kind of pause for user input to exit program
return 0;
}
but I am gettin errors but visual studio is like pissin me off bc I should be able to "using namspace std; without gettin a syntax error or some other bs pissin me off I could b wrong about the above bc i'm new myself but i'm tryin to help
biplav17, nobody can confirm anything, because you haven't posted all of the relevant code yet, nor have you posted what happens when you attempt to run your program.
I can tell you, however, that you're calling a function of type char (which only returns one character, not the string that you might be looking for), and trying to return an int, which is an error in typecasting. In fact, without knowing that you're actually looking for some sort of feedback from the function, which I assume you're not, since you don't send back anything meaningful, the function should be of type void.