Hi,
I received an error message 'incomplete last line' through VI editor. all original lines look like miscoded, I don't know how should I fix it? it's my first time to encounter this issue.
Coud anyone help me please?
User Profile
Collapse
-
converting to normal file on solaris
-
Hi Raghu,
in each interation iam going from back to front of a word while storing into a array of strings form.... -
unable to store as array of strings
Hi ,
I am unable to store the words in a string as array of strings.Could any body comment on this?
void func(char *s) {
int length;
char c;
char **a;
int i,j,l;
int k=0,count=0;
length=strlen(s );
a=(char **)malloc(2*siz eof(char *));
for(i=0;i<2;i++ )
a[i]=(char *)malloc(5);
for(i=0;i<lengt h;i++) {
c=s[i];
if(c=='... -
I want to see how string class is implemented internally. I implemented using string class.In the code above you are taking primitive int type,but my aim is to see for objects....Leave a comment:
-
I used friend function because i need to make the statement char*s="Hello"+ s1;
work. thats why i overloaded + using friend functions because the parameters iam passing are different.
I also overloaded << to output the object s1. My aim is to see how string class is implemented.and to test the overloading concepts etc.....Leave a comment:
-
help for concatenation of string and object.
Hi,
this is the code to print s.
[code=cpp]main() {
sample s1(10,20,30);
char *s;
s="Hello"+s1;
}
friend char * operator +(char *s,sample &b) {
char *s1;
s1 = new char[50];
char *s2;
s2 = new char[10];
strcpy(s1,s);
strcat(s1,"Widt h");
sprintf(s2,"%g" ,b.width);
strcat(s1,s2);...Last edited by AdrianH; May 31 '07, 12:54 PM. Reason: Please use [code=cpp][/code] tags for readability!!
No activity results to display
Show More
Leave a comment: