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

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,855 questions

51,776 answers

573 users

How to write a code for debugging to print variable and variable value in C

1 Answer

0 votes
#include <stdio.h>
 
#define DebugPrint(x) printf("value of \"%s\" is: %d\n",#x, x);
 
int main()
{
    int n1;
    int n2;
     
    n1 = 13;
    n2 = 87;
     
    DebugPrint(n1);
    DebugPrint(n2);
     
    return 0;
}
   
     
/*
       
run:
 
value of "n1" is: 13
value of "n2" is: 87
 
*/

 



answered Jul 7, 2018 by avibootz

Related questions

1 answer 140 views
140 views asked Jul 29, 2017 by avibootz
1 answer 158 views
1 answer 145 views
6 answers 379 views
379 views asked Jul 26, 2017 by avibootz
6 answers 359 views
2 answers 110 views
...