Thread: How to put two programs into one etc help

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,653
    Code:
    char *a2roman (int value, char *c1, char *c2, char *c3)
    {
    	int i;	/* "i" is the index of the iteration */
    	char rRoman[15] = "";
    
    	/* If value = 1, 2, 3 */
    	if ((value >= 1) && (value <= 3))
    	{
    		for (i = 0; i < value; i++)
    			strcat (rRoman, c1);
    	}
    
    	/* If value = 5, 6, 7, 8 */
    	if ((value >= 5) && (value <= 8))
    	{
    		strcat (rRoman, c2);
    
    		for (i = 0; i < (value - 5); i++)
    			strcat (rRoman, c1);
    	}
    
    	/* If value = 4 */
    	if (value == 4)
    	{
    		strcat (rRoman, c1);
    		strcat (rRoman, c2);
    	}
    
    	/* If value = 9 */
    	if (value == 9)
    	{
    		strcat (rRoman, c1);
    		strcat (rRoman, c3);
    	}
    
    	return (rRoman);
    }
    Code:
    Warning	2	warning C4172: returning address of local variable or temporary
    Pass in a buffer and size instead.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    10
    thanks MacGyver

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Communication between programs?
    By johny145 in forum Windows Programming
    Replies: 3
    Last Post: 06-01-2005, 10:14 PM
  2. Problem using java programs within C code
    By lemania in forum Linux Programming
    Replies: 1
    Last Post: 05-08-2005, 02:02 AM
  3. Possible to write adaptive programs?
    By crag2804 in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 06-16-2003, 04:35 PM
  4. How to (let the code) put an object into a game.
    By FromHolland in forum C++ Programming
    Replies: 5
    Last Post: 04-10-2003, 03:44 AM
  5. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 05:42 AM