0Pricing
Zig Academy · Ders

std.debug.print ile Yazdırma

Ekrana metin yazdırın ve değerleri biçimlendirin.

std.debug.print ile Yazdırma, CoddyKit'te ücretsiz bir Zig Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Zig Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Zig Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Your Window into the Program

Printing text is how you see what your code is doing. Zig's quickest way to do that is std.debug.print. 🖨️

Reaching Into std

The dots in std.debug.print are a path: the std module contains debug, which contains the print function you are calling.

const std = @import("std");
std.debug.print("Hello\n", .{});

Two Arguments, Always

print always takes two things: a format string and a tuple of values to fill into it. Even with no values, you pass an empty tuple.

The Empty Argument Tuple

That .{} is an empty tuple. When your text has no placeholders, you still supply it so the function signature is satisfied.

std.debug.print("No values here\n", .{});

Placeholders Use Braces

Inside the format string, {} marks a spot to drop in a value. Each placeholder pulls the next item from your argument tuple in order.

std.debug.print("Score: {}\n", .{42});

Passing Multiple Values

List several values in the tuple and they fill the placeholders left to right, making it easy to combine data in one line.

std.debug.print("{} plus {} is {}\n", .{2, 3, 5});

Format Specifiers

Add a letter inside the braces to control output. For example {s} prints a string slice and {d} forces decimal integer formatting.

std.debug.print("Name: {s}\n", .{"Ada"});

Newlines Are Manual

print does not add line breaks for you. Include the \n escape yourself whenever you want output to move to the next line.

It Writes to stderr

One key detail: std.debug.print sends text to stderr, the error stream. That is fine for learning and quick debugging output.

For Real Output, Use stdout

Serious programs print results to stdout via a writer. But debug.print stays the friendliest choice while you are exploring.

No Allocator Needed

A nice perk: std.debug.print needs no allocator. You can call it anywhere, even before you set up memory management.

Quick Check

You write std.debug.print("Hi\n", .{}). What is the role of the .{} part?

Recap

Use std.debug.print with a format string and an argument tuple. Fill {} placeholders, add \n yourself, and remember it writes to stderr. 🎯

Sıkça Sorulan Sorular

“std.debug.print ile Yazdırma” dersi ücretsiz mi?

Evet — “std.debug.print ile Yazdırma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Zig Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Zig Academy kursu toplamda 4 dersten oluşur.

“std.debug.print ile Yazdırma” dersinde ne öğreneceğim?

Ekrana metin yazdırın ve değerleri biçimlendirin. Zig Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Zig Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Zig Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“std.debug.print ile Yazdırma” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Zig Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Zig Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Zig'i Her Platforma Kurma
  2. İlk main İşleviniz
  3. std.debug.print ile Yazdırma
  4. Tek Adımda Derleyip Çalıştırma
← Zig Academy Sayfasına Dön