Profil de Little.PingB-City--While with...PhotosBlogListes Outils Aide

Blog


12/08/2006

Template....又犯傻了……

竟然把模版的声明和定义分离到两个文件中去……
一个小错误调试了一个小时……
傻了傻了。。。。。
真的傻了……

04/08/2006

这个月的第一段代码……竟然是个.h

#ifndef __TYPESETTING_H__
#define __TYPESETTING_H__
#include <iostream>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>

class TypeSetting
{
public:
    TypeSetting(int s ,  char * filename);   

    //For convenience
    enum a {MAXIMUM = 500};
    //Denotes the maximum numbers of character in a single line
    int        MaximumCharacters;
    //WordCount[i] represents the total characters from word 1 to i
    int        WordCount[MAXIMUM];           
    //The array words stores all the words read from input file
    char     words[MAXIMUM][50];
    int        wordNumber;
    long        linecost[MAXIMUM][MAXIMUM];
    //Keep track of the index of word when the minimum value is reached for each word.
    int        mark[MAXIMUM];



    void CalculateWordCount();

    void CalculateLineCost();
   
    void WorkOut();
   
    void PrintOut(int cursor);

};

#endif