mirror of
				https://codeberg.org/ziglings/exercises.git
				synced 2025-11-04 04:35:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
--- exercises/065_builtins2.zig	2024-11-02 16:58:30.607829441 +0100
 | 
						|
+++ answers/065_builtins2.zig	2024-11-02 16:58:33.821220588 +0100
 | 
						|
@@ -58,7 +58,7 @@
 | 
						|
     // Oops! We cannot leave the 'me' and 'myself' fields
 | 
						|
     // undefined. Please set them here:
 | 
						|
     narcissus.me = &narcissus;
 | 
						|
-    narcissus.??? = ???;
 | 
						|
+    narcissus.myself = &narcissus;
 | 
						|
 
 | 
						|
     // This determines a "peer type" from three separate
 | 
						|
     // references (they just happen to all be the same object).
 | 
						|
@@ -70,7 +70,7 @@
 | 
						|
     //
 | 
						|
     // The fix for this is very subtle, but it makes a big
 | 
						|
     // difference!
 | 
						|
-    const Type2 = narcissus.fetchTheMostBeautifulType();
 | 
						|
+    const Type2 = Narcissus.fetchTheMostBeautifulType();
 | 
						|
 
 | 
						|
     // Now we print a pithy statement about Narcissus.
 | 
						|
     print("A {s} loves all {s}es. ", .{
 | 
						|
@@ -109,15 +109,15 @@
 | 
						|
     // Please complete these 'if' statements so that the field
 | 
						|
     // name will not be printed if the field is of type 'void'
 | 
						|
     // (which is a zero-bit type that takes up no space at all!):
 | 
						|
-    if (fields[0].??? != void) {
 | 
						|
+    if (fields[0].type != void) {
 | 
						|
         print(" {s}", .{fields[0].name});
 | 
						|
     }
 | 
						|
 
 | 
						|
-    if (fields[1].??? != void) {
 | 
						|
+    if (fields[1].type != void) {
 | 
						|
         print(" {s}", .{fields[1].name});
 | 
						|
     }
 | 
						|
 
 | 
						|
-    if (fields[2].??? != void) {
 | 
						|
+    if (fields[2].type != void) {
 | 
						|
         print(" {s}", .{fields[2].name});
 | 
						|
     }
 | 
						|
 
 |