The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 silly problem with lstrcat
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

5*10

Germany
Posts

Posted - 09/12/2005 :  10:12:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7G SR4 v.7.0552
Operating System:win2k

Ok, know a real silly question, but I cant find the reason of this problem:

I'm allways using the lstrcat function to compound two or more string values. It works several times, but in my current function it doesn't work. The following function gets my system break down. Ican not understand this. I try to solve the problem by reading in the manual but I get no hint. Then I debugg the programm and during the last lstrcat-command the system break down whether how many lstrcat commands are called.
The funny thing is, that in an other programm the same lstrcat function works.
Has anybody have this problem?

greets 5*10

void test()
{
string test1="";
string test2="Das";
string test3="0001";
string test4="schei";
out_str(test1);
strcat(test1, test2);
out_str(test1);
strcat(test1, test3);
out_str(test1);
strcat(test1, test4);
out_str(test1);
}

Mike Buess

USA
3037 Posts

Posted - 09/12/2005 :  11:02:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In Origin 7.5 SR5 I get the "Error, function call and declaration mismatch" compiler error for the first strcat line of your function. This compiles and works fine even in 7.0 SR4...

void cattest()
{
//string test1="";
char test1[80];
string test2="Das";
string test3="0001";
string test4="schei";
out_str(test1);
strcat(test1, test2);
out_str(test1);
strcat(test1, test3);
out_str(test1);
strcat(test1, test4);
out_str(test1);
}



Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/12/2005 11:04:33 AM
Go to Top of Page

5*10

Germany
Posts

Posted - 09/13/2005 :  03:17:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for this message!
It works.
But a general question:

Is there any reason, why the lstrcat command works well in another part of my OriginC programm!

greets 5*10

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 09/13/2005 :  07:20:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you look at the remarks for lstrcat in the programming guide you'll find that strcat is its alias... so they are the same function.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/13/2005 07:21:27 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000