怎么向txt文件中追加内容

如何向txt文件中追加内容
写了一个程序,需要向txt文件中添加内容,为button添加的单击消息是:
  FILE *fp;
char msg[]="file content";
char buf[20]="";
fp=fopen("File.txt","w+");
if (NULL==fp)
{
MessageBox("文件不存在");
return;
}

fseek(fp,0,SEEK_END);//定位文件指针到文件终止位置
fwrite(msg,strlen(msg),1,fp);//把字符串内容写入到文件
fclose(fp);
问题是每次点击按钮后在File.txt文件中只有file content,想实现每点击按钮一次就向文件里添加一次,内容格式为:
file content
file content
file content
file content
......

------解决方案--------------------
fopen中的w+属性的含义“"w+"Opens an empty file for both reading and writing. If the given file exists, its contents are destroyed.”(来自CSDN)明确说了,如果要打开的文件存在,则会销毁该文件,你这里应该使用属性“a”,如fp=fopen("File.txt","a");