Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 805 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_cpy -- Invalid arguement #381346
08/26/11 19:08
08/26/11 19:08
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
hey,
I have recently been having trouble with str_cpy, wherever i use it I get an Invalid-Arguement Error in that function.

For example this produces an invalid arguement in main:
Code:
#include <acknex.h>
#include <default.c>
////////////////////////////
STRING* string1[20];

function main()
{
str_cpy(string1, "Why wont this work");
}



It has been a while since i was programming last so it is probably a stupid mistake that I have not noticed.
Thanks in advance laugh.


One day there will be an unfixable bug,
That day is not today.
Re: str_cpy -- Invalid arguement [Re: dakilla] #381348
08/26/11 19:35
08/26/11 19:35
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
When you use an array you have to give the index of the the element where you want to copy the string.
For example:
Code:
str_cpy(string1[2], "Why wont this work");



Re: str_cpy -- Invalid arguement [Re: Aku_Aku] #381349
08/26/11 19:41
08/26/11 19:41
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
hey, thanks for the quick reply.

I meant to define 20 characters within the string instead of 20 blank strings shocked (Rustiness mistake!)

Thanks alot grin


One day there will be an unfixable bug,
That day is not today.
Re: str_cpy -- Invalid arguement [Re: dakilla] #381395
08/27/11 14:57
08/27/11 14:57
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
To define 20 characters in the string:
STRING* mystring="#20";
This way you'll get a 20 char long allocated string initalized with spaces.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1