大佬教程收集整理的这篇文章主要介绍了朋友类可以从C中的朋友类创建对象吗?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#include "remove_duplicates.h" class Hash_class{ protected: list<String> *hashTable; String input_file; String output_file; int input_file_size; friend class remove_duplicates; //void file_size(); public: /*load the words in the hash Table; by calculaTing the hash Code of each String*/ Hash_class(String input_file,String output_file="output_file.txt"); ~Hash_class(){ fclose(input_filE); fclose(ouput_filE); } int hashCode( const String input_word); void loadInHash(); void write_in_output(); int get_input_file_size(){ return input_file_size; } String get_input_file(){ return input_file; } String get_output_file(){ return output_file; } };
在第二个类中,我想从第一个类创建一个对象并对其进行操作,首先填充创建的对象内的哈希表,然后删除所有重复的单词(如果Levenshtein距离接近某个比例) .
#include "Hash_class.h" class remove_duplicates{ protected: Hash_class hash_object; public: remove_duplicates(Hash_class & hash_object); int Levenshtein_distance(String s1,String s2); void set_purge(); };
问题是当我编译代码时出现错误:([错误]’Hash_class’没有命名类型)
如果有可能,请告诉我如何或某些来源我可以了解它.如果不可能那么一些提示将是一件好事,谢谢.
(“我使用C 4.3.2”)
以上是大佬教程为你收集整理的朋友类可以从C中的朋友类创建对象吗?全部内容,希望文章能够帮你解决朋友类可以从C中的朋友类创建对象吗?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。