Solved

Can I make my own Function and how would I define it to do what I want

Posted on 1997-03-29
2
252 Views
Last Modified: 2013-12-26
Well. I just got started with using the language C on my new macintosh and I had some qestions. I was wondering, I read a few books and I saw that it had functiopn like randomize() main() ect... Now, my question is, can I make my own function like malaka() and say I want it to count. Is that possible? And if so, how would I define it. Would it look like

malaka()
{
printf("count from 0 to 10")
return 0;
}

or something. Also, I am very curious with this question. I have noticed that when I open a program, take microsoft excel for example, I notice someting that comes up before I use the program that has the excel logo, copyright, ect.... How can I do that using C? Thanks alot for your time

Send all answers to noula6@tiac.net
0
Comment
Question by:malaka
2 Comments
 

Accepted Solution

by:
carrieb earned 50 total points
ID: 1291428
Hi,
      You sure can make your own function ( that's what programming is all about ).
      your exemple put "count from 0 to 10" on the screen
      it doesn't do the count, if you want to count, it would
      look like that

      malaka()
      { Int I;
          for( I = 0; i <=10 ; i++ )
             Printf("%d\n", i );
          return 0;
        }

      for you second question...
      you don't really need to know C ( you can use other                    langage ) for
      that  , you need more the I Inside Macintosh.
      
      I don't know how familiar you are with the mac
      programming, but if you want to do it,
      you will surely need some of the inside mac.
      ( depending of what you want to do )

      here is how we do it :
      
      first : you make a pict of what you want to
              show ( you could do it on the fly, but
            it would be complicated for nothing )
            
      second : you use the resource.
                 you can use ResEdit or some other.
              you can also make it by hand, but
                 you will need Inside Mac for that.
                 you will make a dialog with the pict
                 you want in it.      
      
      third  : in your programme,
                 you will call the resource and put
                it on the screen...


      there is other way to do this, but i think
      this is the easiest...

      if you want to do this, you will need the inside mac.

      hope this help...


Benoit Carrier
 
0
 

Expert Comment

by:Kheldar
ID: 1291429
Hi,

when you want to make a function of your own, you have to make a function prototype first, like this,



void malaka( void );



Write that line before your main function.

When you want to call it from main, write like this:



malaka();



Outside main(), the function should be written just like carrieb writes, except the first line. It should be like this:



void malaka( void )



I think that would work better.



Adam Axelsson
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
unable to delete all specified values regedit 38 575
either24  challenge 19 101
matchUp  challenge 9 115
changeXy challenge 13 89
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question