[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Modificering af streng i funktion



On Thu, 23 Dec 1999 16:51:19 +0100 (CET), Jesper Monsted wrote:
>On Thu, 23 Dec 1999, Peter Seidler wrote:
>
>> Jeg har et program ala dette
>> 
>> main(int argc, char **argv)
>> {
>> 	char filename[256];
>> 
>> 	parse_args(argc, argv, filename);
>> 
>> 	printf("main: %s", filename);
>> 	
>> 	...
>> }
>> 
>> void parse_args(int argc, char** argv, char* filename)
>> {
>> 	strcpy(filename, argv[1]);	/* Filename is always here. */
>> 	printf("parse_args: %s, %s", filename, argv[1]);
>> }
>
>Det skulle virke - har dog ikke testet...
>
>Glædelig jul til alle!
>
>/Jesper
>
>"Microsoft does have a Year 2000 problem. We're it"
>(c) unknown       - Go Linux! http://www.linux.org/
>
> Jesper Monsted - RIPE: JM42 - sslug@sslug
>

Nu segmention fault'er det - og via nogle printf rundt omkring har jeg
lokaliseret det til at være i strcpy(). Jeg vil dog stadig gerne også vide
hvorfor mit første forsøg mon ikke virkede.

-- 
mvh.
Peter Seidler
sslug@sslug


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *