Parentheses vs Square brackets - C Operator

C examples for Operator:Operator Basics

Introduction

Parentheses increase the precedence of the operations inside them.

Square brackets perform array indexing.

Given an array, the expression within square brackets provides an index into that array. For example,

Demo Code

#include <stdio.h>
char s[80];//from   w  w w .  ja v a  2  s.  c  o  m

int main(void)
{
   s[3] = 'X';
   printf("%c", s[3]);

   return 0;
}

Result


Related Tutorials