救急编程将二维数组变量中内容按要求格式保存到文件C:\svm.vec中~解决方法

救急~编程将二维数组变量中内容按要求格式保存到文件C:\svm.vec中~~~
高手帮忙编程将二维数组变量中内容按下面要求格式保存到文件C:\svm.vec中~~~
现有如下二维数组变量如下:
const   double   m_arrVector[][VEC_LENGTH]={
{3,   20,   190,   5.3,   3,   0,   0,   5},
{11,   120,   78,   6.5,   5,   5,   11,   20}
列为常数,行由
const   int   m_iVectorCount=sizeof(m_arrVector)/(sizeof(double)*VEC_LENGTH)
指定.
保存格式如下:
1.数组每行表示一个向量。
2.行始是一个标志,表明向量的类别。
3.此后依次存放向量的各个分量,每个分量表示为:单元序号:数字。其中序号从1开始。用tab键分隔。
  标志0的向量(3,   20,   190,   5.3,   3,   0,   0,   5)表示为:   注意用Tab分隔
0 1:3 2:20 3:190 4:5.3 5:3 6:0 7:0 8:5
在线等高手指点迷津~~
麻烦帮小弟写写程序,并标上点注释   ,谢谢

------解决方案--------------------
#include <fstream>
#include <cstdlib>
#include <iostream>

using namespace std;

#define VEC_LENGTH 8
int main()
{
const double m_arrVector[][VEC_LENGTH]={
{3, 20, 190, 5.3, 3, 0, 0, 5},
{11, 120, 78, 6.5, 5, 5, 11, 20}};
const int m_iVectorCount=sizeof(m_arrVector)/(sizeof(double)*VEC_LENGTH);

int flag=0, i, j, n;
ofstream outfile( "C:\\svm.vec ");
for(i=0; i <m_iVectorCount; i++)
{
n=1;
//flag=??;
outfile < <flag < <n;
for(j=0; j <VEC_LENGTH; j++)
outfile < < ":\t " < <m_arrVector[i][j];
outfile < <endl;
}
system( "PAUSE ");
return 0;
}

楼主再根据实际情况修正一下 呵呵