Jump to content

Βοήθεια Σε Άσκηση C


jim100

Recommended Posts

Γράψτε ένα πρόγραμμα (με συνάρτηση void shift) το οποίο αφού εισάγει μια ακέραια τιμή έστω α, στη συνέχεια με την συνάρτηση shift να μηδενίζει την τιμή του α.

 

Μπορεί κάποιος να μου δώσει τη λύση. Ευχαριστώ !

Link to comment
Share on other sites

Για διάβασε εδώ, βοηθάει?

 

http://apps.teipir.gr/mhx_nz_csharp/lectures/Lecture04.pdf

Edited by 'Baggos'
Link to comment
Share on other sites

#include <stdio.h>

void shift(int*);

int main(void)
{
int a;
printf("Doste tin timi a");
scanf("%d",&a);
shift(&a);
printf("H kenouria timi tou a einai : %d",a);
}

void shift(int *a)
{
*a=0;
}

Σημειώσεις:

Δουλεψα με δείκτες γιατί μου λες οτι η συνάρτηση δεν κάνει τίποτα (void)

Δεν το εχω δοκιμασει μπορει να εχω κανει κανενα λαθακι.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...