- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
void FileCreate(const char *name)
{
ofstream F;
F.open(name); // Create file
F.close(); //close the file
}
void InputProduct(Product &b) //function for entering product
{
char c; int i=0;
cout<<"Input name of product \n";
// enter the string until you meet the character \n or EOF or until a limit is the number of symbols
for ( i=0; i<l_name && (c = getchar())!= EOF && c!='\n';++i )
b.name[i] = c ;
b.name[i]='\0'; // at the end of the line write the terminating line \0
// rest of code ...
}
Follow us!