摘要: Declaring a global variable as static limits its scope to the same file in which it is defined.A static function is only accessible to the same file i 阅读全文
posted @ 2021-10-05 16:35 xmydis 阅读(80) 评论(0) 推荐(0)
摘要: https://www.geeksforgeeks.org/c-storage-classes-and-type-qualifiers-question-12/ 阅读全文
posted @ 2021-10-05 16:26 xmydis 阅读(19) 评论(0) 推荐(0)
摘要: #include <stdio.h> int f(int n) { static int i = 1; if (n >= 5) return n; n = n + i; i++; return f(n); } int main() { printf("%d", f(1)); int dd = 0; 阅读全文
posted @ 2021-10-05 16:23 xmydis 阅读(32) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int x = 10; static int y = x; if(x == y) printf("Equal"); else if(x > y) printf("Greater"); else printf("Less"); retur 阅读全文
posted @ 2021-10-05 16:19 xmydis 阅读(23) 评论(0) 推荐(0)
摘要: 14 11 8 5 2 #include <stdio.h> int fun() { static int num = 16; return num--; } int main() { for(fun(); fun(); fun()) printf("%d ", fun()); return 0; 阅读全文
posted @ 2021-10-05 16:02 xmydis 阅读(36) 评论(0) 推荐(0)
摘要: #include<stdio.h> int main() { typedef int * i; int j = 10; i *a = &j; printf("%d", **a); int dd = 0; scanf_s("%d", &dd); return 0; } Compiler Error - 阅读全文
posted @ 2021-10-05 15:56 xmydis 阅读(23) 评论(0) 推荐(0)
摘要: #include<stdio.h> int main() { typedef static int *i; int j; i a = &j; printf("%d", *a); return 0; } Explanation: Compiler Error -> Multiple Storage c 阅读全文
posted @ 2021-10-05 15:29 xmydis 阅读(54) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { int x = 5; int * const ptr = &x; ++(*ptr); printf("%d", x); int dd = 0; scanf_s("%d", &dd); return 0; } 6 Explanation: 阅读全文
posted @ 2021-10-05 15:16 xmydis 阅读(38) 评论(0) 推荐(0)
摘要: #include <iostream> using std::cout; class Test { public: int x; // defining mutable variable y // now this can be modified mutable int y; Test() { x 阅读全文
posted @ 2021-10-05 15:03 xmydis 阅读(18) 评论(0) 推荐(0)
摘要: // test100.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; // Function containing static variables // memory is r 阅读全文
posted @ 2021-10-05 14:50 xmydis 阅读(80) 评论(0) 推荐(0)