Thread: cygwin -> unix , my code not working properly ;(

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    25

    cygwin -> unix , my code not working properly ;(

    Hi,

    I recently make this code to concate 2 string...i am using cygwin at home...and this code working as i expected :
    Code:
    char *str_concat( char *string1, char *string2 )
    {
    		
    	char *string3;
    	char *concated_string;
    		
    	int len1, len2;
                
                   /* edited */	
    
    	string3 = '\0';
    
    	return concated_string;
    
    }
    so when i put for example str_concat( mike, mike ) it will return "mikemike" (without the quote)

    however when try to run it at school, in unix machine it doesn't work ( I've change the file format using dos2unix ). if i put str_concat( mike, mike ) it will return "mikemikelv55/k" (without quote) instead of "mikemike" -> and somethin weird, it not always giving addition "lv55/k" sometimes it gives like "xxlv55/k/x" in the back...always in the back...

    this is mess up the whole program of mine ;( it is due on monday..and only becoz of one small part not working, the whole program not gonna work )

    pls help

    Ferdinand
    Last edited by CyC|OpS; 05-18-2002 at 07:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to properly call an executable from C code?
    By remy06 in forum C Programming
    Replies: 3
    Last Post: 05-14-2009, 03:48 AM
  2. Replies: 0
    Last Post: 02-21-2002, 06:05 PM
  3. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM
  4. Working Code Samples Wanted
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 02-13-2002, 10:05 PM
  5. Linked List Working Code
    By Linette in forum C++ Programming
    Replies: 9
    Last Post: 01-24-2002, 12:00 PM