C
csshine
I composed below code but can not pass compiling. Could some one help
this?
------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
using namespace std;
struct Entry{
char name[15];
int number;
};
Entry phone_book[1000];
inline void print_entry(int i) ;
int main()
{
const char phone_book[3].name[15]="I Love You!"; //I want to
assign strings to a char array but fail
print_entry(3);
system("PAUSE");
return 0;
}
void print_entry(int i) //simple use
{
cout<<phone_book.name<<' '<<phone_book.number<<'\n'<<"I
Passed";
}
this?
------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
using namespace std;
struct Entry{
char name[15];
int number;
};
Entry phone_book[1000];
inline void print_entry(int i) ;
int main()
{
const char phone_book[3].name[15]="I Love You!"; //I want to
assign strings to a char array but fail
print_entry(3);
system("PAUSE");
return 0;
}
void print_entry(int i) //simple use
{
cout<<phone_book.name<<' '<<phone_book.number<<'\n'<<"I
Passed";
}