Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,039 questions

40,766 answers

573 users

How to declare an array using sizeof in C

1 Answer

0 votes
#include <stdio.h>

int main() {
    char arr[sizeof(double)] = "c pro";

    printf("%zu\n", sizeof(arr));

    printf("%s\n", arr);

    return 0;
}



/*
run:

8
c pro

*/

 





answered Mar 8 by avibootz

Related questions

2 answers 128 views
1 answer 74 views
74 views asked Sep 17, 2021 by avibootz
1 answer 61 views
61 views asked May 4, 2021 by avibootz
1 answer 92 views
2 answers 120 views
...