Thread: Facing problem with Microsoft Visual Studio

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    5

    Facing problem with Microsoft Visual Studio

    I am facing problem with Microsoft Visual Studio Beta 11. It was working fine till evening but not working now.

    When I compile a program, it says no error but when I debug it, it shows build in errror and following error at run time:

    The program code is following: (Its working fine with other compilers)

    Code:
    #include <stdio.h>
    
    
    void main()
    {
      int a, b, c, d, m, n, p, q;
    
    
      printf("Using For loop\n");
    
    
      printf("Please enter the number of the row\n");
      scanf("%d", &n);
      printf("Please enter the number of the column\n");
      scanf("%d", &m);
      for (a = 1; a <= n; a = a + 1) {
        for (b = 1; b <= m; b++) {
          printf("%4d ", b * a);
        }
        printf("\n");
      }
    
    
      printf("Using While loop\n");
    
    
      printf("Please enter the number of the row\n");
      scanf("%d", &p);
      printf("Please enter the number of the column\n");
      scanf("%d", &q);
      c = 1;
      while (c <= p) {
        d = 1;
        while (d <= q) {
          printf("%4d ", d * c);
          d = d + 1;
        }
        c = c + 1;
        printf("\n");
      }
    
    
    }
    I will highly appreciate your help.
    Last edited by Salem; 04-01-2012 at 10:21 PM. Reason: demunged the font abuse in code

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    It works for me (after changing void main to int main).

    You don't need all those variables, you can reuse them. And
    Code:
    a++;
    is designed to replace the clunkier
    Code:
    a=a+1;

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > When I compile a program, it says no error but when I debug it, it shows build in errror and following error at run time:
    And what error would that be?
    You need to post your actual error messages.

    My guess is either:

    you're seeing "process returned 0xGARBAGE" because you have void main.
    If you had int main() and a return 0; at the end, you would see a consistent process exited with 0x0

    OR
    You're seeing a lot of "unable to load symbols...." for a whole range of DLLs in c:\windows\system32
    These are nothing to worry about. It just limits your ability to debug deep into the system (which you're not going to be doing for a long while).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GDI using microsoft visual studio
    By bos1234 in forum Windows Programming
    Replies: 36
    Last Post: 03-14-2011, 03:58 PM
  2. Help with C++ microsoft visual studio
    By aaa133 in forum C++ Programming
    Replies: 1
    Last Post: 01-09-2011, 05:39 AM
  3. Microsoft visual studio
    By ThWolf in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 08-22-2006, 05:51 AM
  4. Microsoft Visual Studio .NET HELP!!
    By mrafcho001 in forum Tech Board
    Replies: 8
    Last Post: 03-15-2005, 02:16 PM
  5. Using STL with Microsoft Visual Studio C++ 6?
    By MadGooseXP in forum C++ Programming
    Replies: 3
    Last Post: 09-15-2002, 01:14 PM