Online C compiler, visual debugger, and AI tutor - the only tool that lets you visually debug your C code step-by-step (also debug Python, JavaScript, Java, and C++ code)
Here is a demo. Scroll down to compile and run your own code!
C (C17 + GNU extensions)
1#include <stdio.h>
2
3int main() {
4  int x[] = {10, 20, 30};
5  int* p = &x[1]; // pointer into middle
6  char* fruit[3] = {"apples",
7                    "bananas",
8                    "cherries"};
9
10  printf("I have %d %s\n", *p, fruit[1]);
11  return 0;
12}
line that just executed
next line to execute

Print output (drag lower right corner to resize)
Stack
main
x
array
012
int
10
int
20
int
30
p
pointer to int
 
fruit
array
012
pointer to char
 
pointer to char
 
pointer to char
 
Heap
array
0123456
char
'a'
char
'p'
char
'p'
char
'l'
char
'e'
char
's'
char
'\0'
(this is in read-only storage, not the heap)
array
01234567
char
'b'
char
'a'
char
'n'
char
'a'
char
'n'
char
'a'
char
's'
char
'\0'
(this is in read-only storage, not the heap)
array
012345678
char
'c'
char
'h'
char
'e'
char
'r'
char
'r'
char
'i'
char
'e'
char
's'
char
'\0'
(this is in read-only storage, not the heap)
C/C++ details:
Write code in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
int main(void) {
int i = 42;
printf("Wert von i (i) = %d\n", i);
printf("Adresse von i (&i) = %p\n", &i);
int *p = &i; // Pointer p zeigt auf i
printf("Wert von p = Adresse von i (p) = %p\n", p);
printf("Wert, auf den p zeigt = Wert von i (*p) = %d\n", *p);
*p = 7; // i verändert sich...
printf("i = %d\n", i);
int *p2 = p;
*p2 = 100; // i verändert sich...
printf("i = %d\n", i);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

follow our YouTube, TikTok, Instagram for weekly tutorials

hide all code examples

C Examples

Thesis | Globals | Array param | String reverse | Pointers | Pointer chain | Wild pointers

🤖 Greetings, human! 🤖
I'm a new experimental AI Tutor ready to help you. Your code will be automatically sent to me, so do not copy-paste it into your question.

Ask your question below. Or choose a template, edit it, and click "Send":
AI Tutor may be inaccurate. Scroll up and click Edit and re-send to generate a different AI response.

Tips for good questions:

  • Edit your code to be as small as possible.
  • Be specific and ask about specific parts of your code.
  • Include enough context, such as instructions for your assignment.