#include <string.h> int strlen(const char s[]); int strcmp(const char s1[], const char s2[]); char [] strdup(const char s[]); char [] strcpy(char s1[], const char s2[]); char [] strcat (char s1[], const char s2[]);
int main()
{
char s[] = "Hello";
char t[] = "There";
char buf[1024];
cout << strlen(s) << ' ' << strlen(t) << endl;
if ( strcmp(s,t) == 0 )
cout << s << " is equal to " << t << endl;
else
cout << s << " is not equal to " << t << endl;
strcpy(buf, s);
strcat(buf, " ");
strcat(buf, t);
cout << buf; // prints: Hello There
return 0;
}
#include <fstream.h>
#define WORD_LENGTH 80
int main()
{
char word[WORD_LENGTH];
ifstream in("input.txt");
while (in >> word)
cout << word << endl;
in.close();
return 0;
}
#include <fstream.h>
#define WORD_LENGTH 80
int main()
{
char word[WORD_LENGTH];
ifstream in("input.txt");
ofstream out("output.txt");
while (in >> word)
out << word << endl;
in.close();
out.close();
return 0;
}
#include <string.h>
#define LIST_MAX_LENGTH 1024
#define STRING_LENGTH 80
typedef string[STRING_LENGTH]
string arrayList[LIST_MAX_LENGTH];
int cur;
void initialize(int capacity)
{
}
void insert( char item[] )
{
}
void remove( char item[] )
{
}
int findIndexOf( char item[] )
{
}
void copyStringAt( char result[], int i )
{
}
int length()
{
}
int main()
{
return 0;
}