1.

Solve : Black Debug Screen?

Answer»

I am trying to write a C program but every time I run the debugger all I get is a black screen. Personally I am not sure what's wrong, but would appreciate any help. The debugger is Visual Studio 2010 on Windows 10.

Code: [Select]#include<stdio.h>
#include<stdlib.h>

void main()
{
int num;
int i,j,k;
int grd[20];

for(i=0;i<20;i++)
{
grd[i]=5+rand()%(100-5)+1;
}
for(k=0;k<20;k++)
{
num=grd[i]/5;
printf(" %d : ",grd[i]);
for(j=0;j<num;j++)
printf("X");
printf("\n");
}
}
Is it only this program that the debugger goes out to LUNCH with? Have you tried a simple program to see if it also has issues and then add an intentional typo to see if the debugger works

Code Below should execute and show Hello World!. You might have to add a system pause or an input statement to avoid it running and EXITING the console.

Code: [Select]#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
Code Below is missing ; in 2 locations and debugger should point them out on the lines

Code: [Select]#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl
return 0
}



Discussion

No Comment Found