?
Solved

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

Posted on 1997-03-29
2
Medium Priority
?
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
carrieb earned 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

764 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