Compiling issues in Windows Vista with Turbo C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goutham1
    New Member
    • May 2007
    • 13

    Compiling issues in Windows Vista with Turbo C

    hai mate any body plese help me how to run the programme
    after it is compiled.after pressing ctrl f9
    a screen should appear to assagin the values for what we have written.so that it give us answer. please canany body please tell me
  • Extremist
    New Member
    • Jan 2007
    • 94

    #2
    Originally posted by goutham1
    hai mate any body plese help me how to run the programme
    after it is compiled.after pressing ctrl f9
    a screen should appear to assagin the values for what we have written.so that it give us answer. please canany body please tell me
    Wel, Are you in windows or in linux?
    In what editor are you working?

    In Windows:
    I would suggest running it in command prompt for those purposes
    Start - > Run -> Enter "cmd" in the white block
    go to the directory of your compiled file, cd , and then just enter the
    compiled program 's name and press enter

    In Linux:
    Open a terminal, depending on which version you have, would be where
    to find it. change to right directory, cd. you can compile it from there by
    gcc main.c (main.c is your source file) and then say ./main (Where main
    is the executable program

    Comment

    • goutham1
      New Member
      • May 2007
      • 13

      #3
      Originally posted by Extremist
      Wel, Are you in windows or in linux?
      In what editor are you working?

      In Windows:
      I would suggest running it in command prompt for those purposes
      Start - > Run -> Enter "cmd" in the white block
      go to the directory of your compiled file, cd , and then just enter the
      compiled program 's name and press enter

      In Linux:
      Open a terminal, depending on which version you have, would be where
      to find it. change to right directory, cd. you can compile it from there by
      gcc main.c (main.c is your source file) and then say ./main (Where main
      is the executable program
      hai mate u told enter compiled programme name i enter my programme name as float1 which i gave it to it.but is saying that not recognised as internal or external command,operabl e programme or batch file.
      and the next iam using windows vista
      is there any problem with my op sysytem.
      and next is i downladed turbo c compiler i executed my programme
      there were no errors but it is in watch mode iam unable to run the programme
      if i changed to my own programme name also it is not taking it.

      please see that and please help me

      Comment

      • goutham1
        New Member
        • May 2007
        • 13

        #4
        Originally posted by Extremist
        Wel, Are you in windows or in linux?
        In what editor are you working?

        In Windows:
        I would suggest running it in command prompt for those purposes
        Start - > Run -> Enter "cmd" in the white block
        go to the directory of your compiled file, cd , and then just enter the
        compiled program 's name and press enter

        In Linux:
        Open a terminal, depending on which version you have, would be where
        to find it. change to right directory, cd. you can compile it from there by
        gcc main.c (main.c is your source file) and then say ./main (Where main
        is the executable program
        you told me to open command prompt and run and enter cmd .when i opend told me to enter compiled programmes name but when i did this it is showing a error that it is a bad error.please tell how to run c programme .we did compilation to our progrmme there are no errors in my programme.

        Comment

        • AdrianH
          Recognized Expert Top Contributor
          • Feb 2007
          • 1251

          #5
          Originally posted by goutham1
          you told me to open command prompt and run and enter cmd .when i opend told me to enter compiled programmes name but when i did this it is showing a error that it is a bad error.please tell how to run c programme .we did compilation to our progrmme there are no errors in my programme.
          You can do one of the following:
          1. Go to the directory that contains the executable. This directory is in the project directory under another directory (most likely) called Debug or Release. Enter the appropriate directory and execute the file from there.

          2. Run the programme from the debugger. I am assuming that the problem you are experiencing is caused by you generating a terminal programme and that the programme pops up and disappears before you have a chance to react.

            To stop that from happening, you can use the command std::cin.ignore (); or scanf("%*[^\n]") at the end of your programme, depending on what input library you are using. Both will wait for you to press enter prior to terminating the programme.


          Adrian

          Comment

          • goutham1
            New Member
            • May 2007
            • 13

            #6
            Originally posted by goutham1
            you told me to open command prompt and run and enter cmd .when i opend told me to enter compiled programmes name but when i did this it is showing a error that it is a bad error.please tell how to run c programme .we did compilation to our progrmme there are no errors in my programme.

            hai mate my programme is adding two num
            in my syntax i assigned 3 var a,b,c
            i read two values a, b. the total should be printed as c is somm xxx
            everything in my programme is ok i runed it but when it asked me to assaign value a igave xxx valu and b as some value. the total should be printe as c as some xxx.but it is printed as the sum of two numbers is c . when i pressed enter it is not adding that two numbers.

            thanks mate if any body can spend of ur valuble time to deal with this simple problem

            thanks

            Comment

            • ilikepython
              Recognized Expert Contributor
              • Feb 2007
              • 844

              #7
              Originally posted by goutham1
              hai mate my programme is adding two num
              in my syntax i assigned 3 var a,b,c
              i read two values a, b. the total should be printed as c is somm xxx
              everything in my programme is ok i runed it but when it asked me to assaign value a igave xxx valu and b as some value. the total should be printe as c as some xxx.but it is printed as the sum of two numbers is c . when i pressed enter it is not adding that two numbers.

              thanks mate if any body can spend of ur valuble time to deal with this simple problem

              thanks
              Hi,
              I'm not sure what you're trying to do, but if you post your code, I bet we could figure it out. Is the adding the problem or the printing?

              P.S. Try to post in as clear English as possible. Check your post for spelling and gramatical errors before you post it.

              Comment

              • AdrianH
                Recognized Expert Top Contributor
                • Feb 2007
                • 1251

                #8
                Originally posted by ilikepython
                Hi,
                I'm not sure what you're trying to do, but if you post your code, I bet we could figure it out. Is the adding the problem or the printing?.
                Agreed


                Adrian

                Comment

                • goutham1
                  New Member
                  • May 2007
                  • 13

                  #9
                  Originally posted by AdrianH
                  Agreed


                  Adrian
                  hai mate this is my programme . i wanted to add two numbers.iam writing my programme please see this and if u find any thing problem please correct it and send me .
                  [code=cpp]int main ( )
                  {
                  int a, b, c;
                  printf("enter a number a",a);
                  scanf("%d",a);
                  printf("enter a number b",b);
                  scanf("%d",b);
                  printf("enter a number c",c);
                  scanf("%d",c);
                  return( 0);
                  }[/code]
                  Last edited by AdrianH; May 16 '07, 01:23 PM. Reason: Please use [code][/code] tags.

                  Comment

                  • AdrianH
                    Recognized Expert Top Contributor
                    • Feb 2007
                    • 1251

                    #10
                    Originally posted by goutham1
                    hai mate this is my programme . i wanted to add two numbers.iam writing my programme please see this and if u find any thing problem please correct it and send me .
                    [code=cpp]int main ( )
                    {
                    int a, b, c;
                    printf("enter a number a",a);
                    scanf("%d",a);
                    printf("enter a number b",b);
                    scanf("%d",b);
                    printf("enter a number c",c);
                    scanf("%d",c);
                    return( 0);
                    }[/code]
                    That won't work. scanf expects poniters to the variables after the format string. i.e. &a not a


                    Adrian

                    Comment

                    • goutham1
                      New Member
                      • May 2007
                      • 13

                      #11
                      Originally posted by AdrianH
                      That won't work. scanf expects poniters to the variables after the format string. i.e. &a not a


                      Adrian
                      u told me to change a as &a. but in my out put it should show the sum of two numbers is some xxx. but after entering a and b values it is printing like the sum of two numbers is c. it is not printing the sum of two numbers.iam compiling in cpp by changing the file name as .c.
                      and also iam using vista is that has any problem in executing my programme.


                      can u please send me the correct programe.

                      Comment

                      • AdrianH
                        Recognized Expert Top Contributor
                        • Feb 2007
                        • 1251

                        #12
                        Originally posted by goutham1
                        u told me to change a as &a. but in my out put it should show the sum of two numbers is some xxx. but after entering a and b values it is printing like the sum of two numbers is c. it is not printing the sum of two numbers.iam compiling in cpp by changing the file name as .c.
                        and also iam using vista is that has any problem in executing my programme.


                        can u please send me the correct programe.
                        But your app is doing what you told it to do. To get three numbers from the user. If you want it to get two numbers from the user and then add them up and print them out, then you should do so by adding them and printing the result.

                        You know how to print (it shows it in your code), and I assume you know how to add (hint: use the '+' operator). So what is the problem? I've spelled out the answer for you, but I'm not going to write out the answer for you.


                        Adrian

                        Comment

                        • goutham1
                          New Member
                          • May 2007
                          • 13

                          #13
                          hai mate
                          can any body tell what is the problem that iam always getting a error in my programme for printf statment .an error message is generating while compiling.that printf statement should have a prototype.

                          and second thing if i include # include(stdio.h )in my programme there is a error statement telling that "bad file name format in include directive."

                          thanks.

                          Comment

                          • ilikepython
                            Recognized Expert Contributor
                            • Feb 2007
                            • 844

                            #14
                            Originally posted by goutham1
                            hai mate
                            can any body tell what is the problem that iam always getting a error in my programme for printf statment .an error message is generating while compiling.that printf statement should have a prototype.

                            and second thing if i include # include(stdio.h )in my programme there is a error statement telling that "bad file name format in include directive."

                            thanks.
                            Yea, you don't use include with parenthesis. You can use either angle brackets or quotes. Like this:
                            [code=c]
                            #include <stdio.h>
                            [/code]

                            Comment

                            • goutham1
                              New Member
                              • May 2007
                              • 13

                              #15
                              Originally posted by ilikepython
                              Yea, you don't use include with parenthesis. You can use either angle brackets or quotes. Like this:
                              [code=c]
                              #include <stdio.h>
                              [/code]
                              inspite of including # include <stdio.h>iam getting an error statement function should return a value.

                              please see this.
                              thanks for ur help.

                              Comment

                              Working...