help in basic C

This is a discussion on help in basic C within the C Programming forums, part of the General Programming Boards category; So can I make the combine function return str1? Putting str1 at the beginning of the function prototype? Also for ...

  1. #16
    Registered User
    Join Date
    Oct 2007
    Posts
    18
    So can I make the combine function return str1? Putting str1 at the beginning of the function prototype? Also for my problem with my linked list, needing to have another prompt to add to the linked list and redisplay: should I use the pop or insert function? I have never used either, but I think I need to. I am not sure how

  2. #17
    Registered User
    Join Date
    Oct 2007
    Posts
    18
    I tried to make those changes, but it seems to have more errors.
    insert
    Code:
    #include "stdafx.h"
    
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	char combine(char*new_str1, int n, char c, float f);
    	char str1[100];
    	int n;
    	char c;
    	float f;
    
    printf("\nEnter an integer:\n");
    	scanf_s("%d", &n);
    	printf("\nEnter a character:\n");
    	scanf_s("%c", &c);
    	printf("\nEnter a floating point number:\n");
    	scanf_s("%f", &f);
    
     combine(str1, n,c,f);
    	puts(str1);
    	return 0;
    }
    
     char combine(char*new_str1,  n,  c, f,)
     {
    		str1=sprintf_s(str1, "%d, %c, %f", n,c,f);
    	return (str1);
     }

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 09:28 AM
  2. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  3. visual basic vs C or C++
    By FOOTOO in forum Windows Programming
    Replies: 5
    Last Post: 02-06-2005, 07:41 PM
  4. Basic Graphics programming in C, please help
    By AdRock in forum Game Programming
    Replies: 3
    Last Post: 03-24-2004, 10:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21