C Program..help
c:\users\yan\desktop\glossary_demo.h(2) : error C2236: unexpected 'class' 'defined' c:\users\yan\desktop\glossary_demo.h(2) : error C2144: syntax error : missing ';' before type 'defined' c:\users\yan\desktop\glossary_demo.h(2) : error C2501: 'abstract' : missing storage-class or type specifiers c:\users\yan\desktop\glossary_demo.h(2) : fatal error C1004: unexpected end of file found Error executing cl.exe.
#include < stido.h>
#include < string.h>
#include < stdlib.h>
char*ArryString[1000];
char*key[80];
char result[256];
int IineRend;
#include"glossary_demo.h"//not implemented.use glossary_stored at the main time
int main()
{
IineRend=rendFile();
//sortArray();
for(int i=0; i<IineRend;i++)
{
printf("%S\n",ArryString[i]);
}
while(inputkey()!=0)
}
int value;
bool found =searchkey(&value);
displayResult(found,value);
}
I make a new file(h) on the Desktop>>>>>>glossary_demo.h
the following 开发者_高级运维content:
abstract class
a class defined to make creating subclass easier
array
an ordered collection of values
collection
class that used for grouping and manipulating related objects
compile time
the time during which the source code is analyzed and converted into object code
dictionary
a collection of key/value pairs
framework
a collection of classes, functions and protocols that are related to support certain
platform
instance
a concrete representation of a class
message
the method and its associated arguments that are sent to an object
retain count
a count of the number of times an object is referenced
selector
the name used to select the method to execute for an object
I want to the screen showing ,when I input:selector then show me( the name used.......
You're using
#include "glossary_demo.h"
which is basically injecting the contents of glossary_demo.h
into your code at compile-time. Your glossary_demo.h
file isn't valid C, which is why you're getting all those errors.
It sounds like really you want to load a text file at execution time, which is very different.
You have tagged your question C
, but class
can be used only in C++
, not C
.
Your error is from file glossary_demo.h
, please show contents of that.
BTW, it must be
#include <stdio.h> (not <stido.h>)
精彩评论