Unusual character when writing to file : <p>I've created a struct with 2 char[] and one int. I created an array of this struct and <code>scanf</code>ed several inputs to store data into the array. Then I used <code>fprintf</code> to write this data to the file. But when I open the file I get <code>û</code> before every new record. Idk why is it happening.</p>

<p>Here's the relevant code:</p>

<pre><code>FILE *outputFile=fopen("1021.txt","ab");
int tickets=0,i=1;
struct air s[30];
printf("\nEnter Number of tickets:");
scanf("%d",&amp;tickets);
for (i=1;i&lt;=tickets;i++)
{
    printf("\nEnter the name\t");
    scanf("%s",&amp;s[i].name);
    printf("\nEnter the phone number\t");
    scanf("%s",&amp;s[i].phoneNo);
    printf("\n Enter the address\t");

    scanf("%s",&amp;s[i].address);
    printf("Your ticket is confirmed\t");
    getch();
}
for (i=0;i&lt;=tickets;i++)
{
    printf("%s", s[i].name);
    printf("%s", s[i].phoneNo);
    printf("%s", s[i].address);
    fprintf(outputFile,"%s",s[i].name);
    fprintf(outputFile,"%s",s[i].phoneNo);
    fprintf(outputFile,"%s",s[i].address);
}
</code></pre>

<p>Here's what I get in the file:
ûdalla03332228458dallaÈfsÇûÿÿÿÿàrancho03312041265dallabancho</p>

<p>Where are those unusual characters coming from?</p>
