Hello, i am new in c programming it is just the second month i i deal with. I am really confusing about what i have to do with this exercise pls don't lough on me I hope for some help. That's what i have to do..
I have to modify an .ini file.
The user should enter a name which must be name1 or name2 else he get an error.
The user should enter the value of the name
the format is name1(or 2)=value
If the user use -D the input gets delete from ini
if the user dont enter both name and value gets an error
if the arguements allready exist replace them, if not add them
close file.
Thats what i have tried i have stuck soz again for this bad programme as i said its my second month
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <string.h>
int delete= 0;
char parname[20];
char valname[20];
FILE *fdin;
char file[300];
char infile[60];
void main(int argc, char* argv[])
{if (argc!=3)
return;
strcpy(parname,argv[1]);
printf("Enter Parameter Name= %s \n",parname);
printf("Enter the value= %s \n",valname);
if ((fdin=fopen(infile,"r"))==NULL)
{ printf ("Open Error");
return;
}
for (n=0 ; fgets(file,sizeof(file),fdin); ++n)
for (i=2;i<argc;++i)
{ if(strcmp(argv[i],"-D")==0)
delete=-1;