में अनुमति दी गई है मुझे निम्न त्रुटि मिल रही है, std = c99/std = gnu99 मोड क्या है?त्रुटि: 'for' लूप प्रारंभिक घोषणाओं को केवल C99 मोड
स्रोत कोड:
#include <stdio.h>
void funct(int[5]);
int main()
{
int Arr[5]={1,2,3,4,5};
funct(Arr);
for(int j=0;j<5;j++)
printf("%d",Arr[j]);
}
void funct(int p[5]) {
int i,j;
for(i=6,j=0;i<11;i++,j++)
p[j]=i;
}
Error Message:
hello.c: In function ‘main’:
hello.c:11:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int j=0;j<5;j++)
^
hello.c:11:2: note: use option -std=c99 or -std=gnu99 to compile your code`
आपको या तो लूप के बाहर जे घोषित करने की आवश्यकता है, या संकलन का उपयोग करके संकलित करना होगा -std = c99 विकल्प त्रुटि संदेश राज्यों की तरह। – Loocid