Browse Source

Baby's first pointer

nsITobin 3 months ago
parent
commit
8b8cb04dca
1 changed files with 4 additions and 4 deletions
  1. 4 4
      nsMain.c

+ 4 - 4
nsMain.c

@@ -13,9 +13,9 @@ struct NS_OUTPUT {
 
 // == | Functions | ===================================================================================================
 
-int nsOutput(const int *aReturnValue, const char *aMessage) {
-  printf( "%s\n", aMessage);
-  return aReturnValue;
+int nsOutput(struct NS_OUTPUT *aOutput) {
+  printf( "%s\n", aOutput->message);
+  return aOutput->rv;
 }
 
 // ====================================================================================================================
@@ -24,7 +24,7 @@ int nsOutput(const int *aReturnValue, const char *aMessage) {
 
 int main() {
   struct NS_OUTPUT output = { 0, "Have I reached the party to whom I am speaking?" };
-  return nsOutput(output.rv, output.message);
+  return nsOutput(&output);
 }
 
 // ====================================================================================================================