Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Visual C++ and C programming

Visual C++ and C programming

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiotutorialquestion
30 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thierrypp
    wrote on last edited by
    #1

    Hi, God Morning/afternoon, May I know how to work with c files on a visual C++ 6.0 IDE? Some people say it is easy, howver I am encountering a lot of problems. examples simple. project. the c file looks like: /* ------------- */ /* mon_include.c */ /* ------------- */ #include main() { #include "mon_include.h" i = 10 ; j = 20 ; k = i+j ; printf("k = %d\n",k); } and the *.h file /* ------------- */ /* mon_include.h */ /* ------------- */ int i,j ; int k ; /* ------------- */ Thanks a lot, I work on Visual C++ 6.0 introductory edition. T.

    T D R 3 Replies Last reply
    0
    • T thierrypp

      Hi, God Morning/afternoon, May I know how to work with c files on a visual C++ 6.0 IDE? Some people say it is easy, howver I am encountering a lot of problems. examples simple. project. the c file looks like: /* ------------- */ /* mon_include.c */ /* ------------- */ #include main() { #include "mon_include.h" i = 10 ; j = 20 ; k = i+j ; printf("k = %d\n",k); } and the *.h file /* ------------- */ /* mon_include.h */ /* ------------- */ int i,j ; int k ; /* ------------- */ Thanks a lot, I work on Visual C++ 6.0 introductory edition. T.

      T Offline
      T Offline
      Tombo
      wrote on last edited by
      #2

      I think this is what you want to do? { FILE *flog; i = 10 ; j = 20 ; k = i+j ; flog = fopen("c:\\directory\\test.txt", "w"); fprintf( flog,"%s, %d\n","k=",k ); fclose ( flog ); } If you look in the directory called "directory" you should find your file (test.txt).

      F 1 Reply Last reply
      0
      • T Tombo

        I think this is what you want to do? { FILE *flog; i = 10 ; j = 20 ; k = i+j ; flog = fopen("c:\\directory\\test.txt", "w"); fprintf( flog,"%s, %d\n","k=",k ); fclose ( flog ); } If you look in the directory called "directory" you should find your file (test.txt).

        F Offline
        F Offline
        FarPointer
        wrote on last edited by
        #3

        :laugh:I think this is what you want to do? Tombo Would you please tell how that guy can use this, please check before you post something . Regards, FarPointer

        1 Reply Last reply
        0
        • T thierrypp

          Hi, God Morning/afternoon, May I know how to work with c files on a visual C++ 6.0 IDE? Some people say it is easy, howver I am encountering a lot of problems. examples simple. project. the c file looks like: /* ------------- */ /* mon_include.c */ /* ------------- */ #include main() { #include "mon_include.h" i = 10 ; j = 20 ; k = i+j ; printf("k = %d\n",k); } and the *.h file /* ------------- */ /* mon_include.h */ /* ------------- */ int i,j ; int k ; /* ------------- */ Thanks a lot, I work on Visual C++ 6.0 introductory edition. T.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          thierrypp wrote:

          ...howver I am encountering a lot of problems.

          And what would those problems be?

          thierrypp wrote:

          #include "mon_include.h"

          Did you mean to have this statement inside of main()?


          "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

          T 1 Reply Last reply
          0
          • D David Crow

            thierrypp wrote:

            ...howver I am encountering a lot of problems.

            And what would those problems be?

            thierrypp wrote:

            #include "mon_include.h"

            Did you mean to have this statement inside of main()?


            "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

            T Offline
            T Offline
            thierrypp
            wrote on last edited by
            #5

            thank you, but really, more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler? and how? Regards, T.

            D G 2 Replies Last reply
            0
            • T thierrypp

              thank you, but really, more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler? and how? Regards, T.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              thierrypp wrote:

              can a common C programme be compiled on a Visual C++ 6.0 compiler?

              Certainly. Why wouldn't it?


              "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

              T 2 Replies Last reply
              0
              • D David Crow

                thierrypp wrote:

                can a common C programme be compiled on a Visual C++ 6.0 compiler?

                Certainly. Why wouldn't it?


                "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                T Offline
                T Offline
                thierrypp
                wrote on last edited by
                #7

                I have a set of C files which can be compiled on a C-compiler, but not at all on Visual C++6.0. Maybe you could tell me the right procedure to do it......... Or I can send you examples? Thank you, T.

                1 Reply Last reply
                0
                • D David Crow

                  thierrypp wrote:

                  can a common C programme be compiled on a Visual C++ 6.0 compiler?

                  Certainly. Why wouldn't it?


                  "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                  T Offline
                  T Offline
                  thierrypp
                  wrote on last edited by
                  #8

                  for example: /* ---------- */ /* premier2.c */ /* ---------- */ #include #include main() { int nb, diviseur1, diviseur2,reste ; int trouve,i ,racinecar,limite ; int nb_iterations=1; printf("Entrez un Nombre :"); scanf("%d",&nb); /* partie entiere de la racine carre+1 */ limite=sqrt(nb)+1; trouve=0 ; if (nb != 2) /* 2 est premier */ { /* on retire le cas des nombres pairs */ reste=nb%2 ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=2 ; diviseur2=nb/2 ; } else { /* teste tous les diviseurs impairs */ i=3; while ( (! trouve) && (i<=limite) ) { nb_iterations++; reste= nb%i ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=i ; diviseur2=nb/i ; } i+=2 ; } } } if (trouve) { printf("%d n'est pas premier !\n",nb); printf("il est divisible par %d et %d\n",diviseur1,diviseur2); } else { printf("%d est un nombre PREMIER !\n",nb); } printf("RŽsultat obtenu en %d itŽrations\n",nb_iterations); } result: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/premier2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. premier2.exe - 2 error(s), 0 warning(s)

                  D 1 Reply Last reply
                  0
                  • T thierrypp

                    thank you, but really, more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler? and how? Regards, T.

                    G Offline
                    G Offline
                    Graham Bradshaw
                    wrote on last edited by
                    #9

                    thierrypp wrote:

                    more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler?

                    Yes. But... Visual C++ 6 applies a C++ compiler to files with a .cpp extension, and a C compiler to files with a .c extension. Do your source files have a .c extension? What errors are you getting?

                    T 2 Replies Last reply
                    0
                    • T thierrypp

                      for example: /* ---------- */ /* premier2.c */ /* ---------- */ #include #include main() { int nb, diviseur1, diviseur2,reste ; int trouve,i ,racinecar,limite ; int nb_iterations=1; printf("Entrez un Nombre :"); scanf("%d",&nb); /* partie entiere de la racine carre+1 */ limite=sqrt(nb)+1; trouve=0 ; if (nb != 2) /* 2 est premier */ { /* on retire le cas des nombres pairs */ reste=nb%2 ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=2 ; diviseur2=nb/2 ; } else { /* teste tous les diviseurs impairs */ i=3; while ( (! trouve) && (i<=limite) ) { nb_iterations++; reste= nb%i ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=i ; diviseur2=nb/i ; } i+=2 ; } } } if (trouve) { printf("%d n'est pas premier !\n",nb); printf("il est divisible par %d et %d\n",diviseur1,diviseur2); } else { printf("%d est un nombre PREMIER !\n",nb); } printf("RŽsultat obtenu en %d itŽrations\n",nb_iterations); } result: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/premier2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. premier2.exe - 2 error(s), 0 warning(s)

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #10

                      What type of project is this .c file a part of? What preprocessor definitions do you have defined? You need _WIN32 and _CONSOLE at a minimum. Also be sure /subsystem:console is one of the linker options.


                      "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                      T 1 Reply Last reply
                      0
                      • G Graham Bradshaw

                        thierrypp wrote:

                        more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler?

                        Yes. But... Visual C++ 6 applies a C++ compiler to files with a .cpp extension, and a C compiler to files with a .c extension. Do your source files have a .c extension? What errors are you getting?

                        T Offline
                        T Offline
                        thierrypp
                        wrote on last edited by
                        #11

                        yes, files with a c extension *.c for example: and result of compilation.. for example: /* ---------- */ /* premier2.c */ /* ---------- */ #include #include main() { int nb, diviseur1, diviseur2,reste ; int trouve,i ,racinecar,limite ; int nb_iterations=1; printf("Entrez un Nombre :"); scanf("%d",&nb); /* partie entiere de la racine carre+1 */ limite=sqrt(nb)+1; trouve=0 ; if (nb != 2) /* 2 est premier */ { /* on retire le cas des nombres pairs */ reste=nb%2 ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=2 ; diviseur2=nb/2 ; } else { /* teste tous les diviseurs impairs */ i=3; while ( (! trouve) && (i<=limite) ) { nb_iterations++; reste= nb%i ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=i ; diviseur2=nb/i ; } i+=2 ; } } } if (trouve) { printf("%d n'est pas premier !\n",nb); printf("il est divisible par %d et %d\n",diviseur1,diviseur2); } else { printf("%d est un nombre PREMIER !\n",nb); } printf("RŽsultat obtenu en %d itŽrations\n",nb_iterations); } result: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/premier2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. premier2.exe - 2 error(s), 0 warning(s)

                        B G 2 Replies Last reply
                        0
                        • D David Crow

                          What type of project is this .c file a part of? What preprocessor definitions do you have defined? You need _WIN32 and _CONSOLE at a minimum. Also be sure /subsystem:console is one of the linker options.


                          "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                          T Offline
                          T Offline
                          thierrypp
                          wrote on last edited by
                          #12

                          honestly here I am a bit lost.... well ...here is an example of a typical c file, complete! I have VC++ 6.0 standard edition. But I am really a newbie in converting c files on VC++ 6.0 Maybe you could tell me how to proceed and which changes? Usually, I click on the file and immediatelly the VC++ appears.. Thanks, T -------->example of a comple c file /* ------------------ */ /* liste_structure2.c */ /* ------------------ */ #include #include #define TAILLE_NOM 20 #define TAILLE_PRENOM 30 /* --- sous-programmes --- */ void saisie() ; void affichage() ; struct etudiant *recherche(char nom_recherche[]); void modification() ; /* --- variables globales --- */ struct etudiant { struct etudiant *pred ; char nom[TAILLE_NOM] ; char prenom[TAILLE_PRENOM]; int age ; struct etudiant *succ ; } ; struct etudiant *debut_liste,*fin_liste; int nbeleves=0; /* ===== PROGRAMME ===== */ main() { char choix=' ', ch_saisie[20]; debut_liste = NULL; fin_liste = NULL; while (choix!='q') { printf("-1- Saisie d'une liste\n"); printf("-2- Affichage\n"); printf("-3- Modification d'un Žlve\n"); printf("-q- quitter\n"); printf("Choix : "); scanf("%s",ch_saisie); choix=ch_saisie[0]; switch(choix) { case '1' : saisie(); break; case '2' : affichage(); break; case '3' : modification(); break; case 'q' : printf("Au revoir\n"); break; default : printf("Choix non valide\n"); break; } } } /* === chargement de la liste === */ void saisie() { struct etudiant *nouv_eleve,*eleve_actuel; int termine = 0 ; /* --- boucle de saisie --- */ while (! termine) { nouv_eleve = malloc(sizeof(struct etudiant)); printf("Entrez un nom ( nom=fin pour terminer):"); scanf("%s",nouv_eleve->nom); termine=((strcmp(nouv_eleve->nom,"fin"))==0) ; if (! termine) /* saisie du reste */ { printf("Entrez un prŽnom:") ; scanf("%s",nouv_eleve->prenom); printf("Entrez un ‰ge:") ; scanf("%d",&(nouv_eleve->age)); nouv_eleve->pred=NULL ; nouv_eleve->succ=NULL ; if (debut_liste == NULL) { /* Liste vide. C'est le seul element */ debut_liste = nouv_eleve ; f

                          D 1 Reply Last reply
                          0
                          • G Graham Bradshaw

                            thierrypp wrote:

                            more generally, can a common C programme be compiled on a Visual C++ 6.0 compiler?

                            Yes. But... Visual C++ 6 applies a C++ compiler to files with a .cpp extension, and a C compiler to files with a .c extension. Do your source files have a .c extension? What errors are you getting?

                            T Offline
                            T Offline
                            thierrypp
                            wrote on last edited by
                            #13

                            sorry, with: #include #include I am so upset to get it right! yes, win32 checked and sub console too in the linker option too! Thanks for your very helpful help. Knowing finally how to deal with C files on Visual C++ would be of the utmost importance! Best Regards, Please, feel free to send me any screenshots.....I welcome you! T. Switzerland

                            1 Reply Last reply
                            0
                            • T thierrypp

                              yes, files with a c extension *.c for example: and result of compilation.. for example: /* ---------- */ /* premier2.c */ /* ---------- */ #include #include main() { int nb, diviseur1, diviseur2,reste ; int trouve,i ,racinecar,limite ; int nb_iterations=1; printf("Entrez un Nombre :"); scanf("%d",&nb); /* partie entiere de la racine carre+1 */ limite=sqrt(nb)+1; trouve=0 ; if (nb != 2) /* 2 est premier */ { /* on retire le cas des nombres pairs */ reste=nb%2 ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=2 ; diviseur2=nb/2 ; } else { /* teste tous les diviseurs impairs */ i=3; while ( (! trouve) && (i<=limite) ) { nb_iterations++; reste= nb%i ; if (reste == 0) { trouve=1 ; /* on memorise les diviseurs */ diviseur1=i ; diviseur2=nb/i ; } i+=2 ; } } } if (trouve) { printf("%d n'est pas premier !\n",nb); printf("il est divisible par %d et %d\n",diviseur1,diviseur2); } else { printf("%d est un nombre PREMIER !\n",nb); } printf("RŽsultat obtenu en %d itŽrations\n",nb_iterations); } result: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/premier2.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. premier2.exe - 2 error(s), 0 warning(s)

                              B Offline
                              B Offline
                              BadKarma
                              wrote on last edited by
                              #14

                              hi, when code compiled is with a c++ compiler the code needs to be c++ compiler compatible. C code is almost 90% compliant to c++ code, but there are some distinct issues that one must know off.

                              thierrypp wrote:

                              LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

                              this error means that the compiler didn't find the main entry point of your code. you did write

                              #include <something>
                              
                              main()
                              {
                              

                              you did forget to add a return value for your main function. Some C compilers automatically asume that you meant to write int main(void) but most C++ compilers don't do this automatic translation. Thats way the function main didn't compile hence there is no function to link too -> Unresolved external The rest of the code looks fine. codito ergo sum

                              T D 2 Replies Last reply
                              0
                              • T thierrypp

                                honestly here I am a bit lost.... well ...here is an example of a typical c file, complete! I have VC++ 6.0 standard edition. But I am really a newbie in converting c files on VC++ 6.0 Maybe you could tell me how to proceed and which changes? Usually, I click on the file and immediatelly the VC++ appears.. Thanks, T -------->example of a comple c file /* ------------------ */ /* liste_structure2.c */ /* ------------------ */ #include #include #define TAILLE_NOM 20 #define TAILLE_PRENOM 30 /* --- sous-programmes --- */ void saisie() ; void affichage() ; struct etudiant *recherche(char nom_recherche[]); void modification() ; /* --- variables globales --- */ struct etudiant { struct etudiant *pred ; char nom[TAILLE_NOM] ; char prenom[TAILLE_PRENOM]; int age ; struct etudiant *succ ; } ; struct etudiant *debut_liste,*fin_liste; int nbeleves=0; /* ===== PROGRAMME ===== */ main() { char choix=' ', ch_saisie[20]; debut_liste = NULL; fin_liste = NULL; while (choix!='q') { printf("-1- Saisie d'une liste\n"); printf("-2- Affichage\n"); printf("-3- Modification d'un Žlve\n"); printf("-q- quitter\n"); printf("Choix : "); scanf("%s",ch_saisie); choix=ch_saisie[0]; switch(choix) { case '1' : saisie(); break; case '2' : affichage(); break; case '3' : modification(); break; case 'q' : printf("Au revoir\n"); break; default : printf("Choix non valide\n"); break; } } } /* === chargement de la liste === */ void saisie() { struct etudiant *nouv_eleve,*eleve_actuel; int termine = 0 ; /* --- boucle de saisie --- */ while (! termine) { nouv_eleve = malloc(sizeof(struct etudiant)); printf("Entrez un nom ( nom=fin pour terminer):"); scanf("%s",nouv_eleve->nom); termine=((strcmp(nouv_eleve->nom,"fin"))==0) ; if (! termine) /* saisie du reste */ { printf("Entrez un prŽnom:") ; scanf("%s",nouv_eleve->prenom); printf("Entrez un ‰ge:") ; scanf("%d",&(nouv_eleve->age)); nouv_eleve->pred=NULL ; nouv_eleve->succ=NULL ; if (debut_liste == NULL) { /* Liste vide. C'est le seul element */ debut_liste = nouv_eleve ; f

                                D Offline
                                D Offline
                                David Crow
                                wrote on last edited by
                                #15

                                There's no need to post all of this code. Most, if not all, of it is irrelevant. Open Visual Studio. Select New from the File menu. Click the Projects tab. Near the bottom of the list, select Win32 Console Application, give the project a name, and click the OK button. On the Step 1 of 1 dialog box, select one of the four radio buttons (e.g., A "Hello World" application). Click the Finish button. Click the OK button. Now open the main .cpp file and paste your code into it, overriding whatever is there. Press F7 to compile and link. Does that help?


                                "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                                T 1 Reply Last reply
                                0
                                • B BadKarma

                                  hi, when code compiled is with a c++ compiler the code needs to be c++ compiler compatible. C code is almost 90% compliant to c++ code, but there are some distinct issues that one must know off.

                                  thierrypp wrote:

                                  LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

                                  this error means that the compiler didn't find the main entry point of your code. you did write

                                  #include <something>
                                  
                                  main()
                                  {
                                  

                                  you did forget to add a return value for your main function. Some C compilers automatically asume that you meant to write int main(void) but most C++ compilers don't do this automatic translation. Thats way the function main didn't compile hence there is no function to link too -> Unresolved external The rest of the code looks fine. codito ergo sum

                                  T Offline
                                  T Offline
                                  thierrypp
                                  wrote on last edited by
                                  #16

                                  yes, right, #include #include but I do not get how to deal with main, what should be modified? Thanks, T.

                                  B 1 Reply Last reply
                                  0
                                  • B BadKarma

                                    hi, when code compiled is with a c++ compiler the code needs to be c++ compiler compatible. C code is almost 90% compliant to c++ code, but there are some distinct issues that one must know off.

                                    thierrypp wrote:

                                    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

                                    this error means that the compiler didn't find the main entry point of your code. you did write

                                    #include <something>
                                    
                                    main()
                                    {
                                    

                                    you did forget to add a return value for your main function. Some C compilers automatically asume that you meant to write int main(void) but most C++ compilers don't do this automatic translation. Thats way the function main didn't compile hence there is no function to link too -> Unresolved external The rest of the code looks fine. codito ergo sum

                                    D Offline
                                    D Offline
                                    David Crow
                                    wrote on last edited by
                                    #17

                                    BadKarma wrote:

                                    ...but most C++ compilers don't do this automatic translation.

                                    Visual Studio v6 handles this just fine. He is doing something else wrong as his code compiles fine as a .c file or a .cpp file. I suspect it's the type of project he chose.


                                    "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                                    B 1 Reply Last reply
                                    0
                                    • D David Crow

                                      There's no need to post all of this code. Most, if not all, of it is irrelevant. Open Visual Studio. Select New from the File menu. Click the Projects tab. Near the bottom of the list, select Win32 Console Application, give the project a name, and click the OK button. On the Step 1 of 1 dialog box, select one of the four radio buttons (e.g., A "Hello World" application). Click the Finish button. Click the OK button. Now open the main .cpp file and paste your code into it, overriding whatever is there. Press F7 to compile and link. Does that help?


                                      "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                                      T Offline
                                      T Offline
                                      thierrypp
                                      wrote on last edited by
                                      #18

                                      yes, but there an error message: Compiling... ooooo.cpp c:\documents and settings\atvd\desktop\new folder00ppp\ooooo\ooooo.cpp(161) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. ooooo.exe - 1 error(s), 0 warning(s) and when clicking on the error message , it shows the end, after the last } maybe I should ad a main...? how...? Thanks a lot!

                                      B 1 Reply Last reply
                                      0
                                      • T thierrypp

                                        yes, right, #include #include but I do not get how to deal with main, what should be modified? Thanks, T.

                                        B Offline
                                        B Offline
                                        BadKarma
                                        wrote on last edited by
                                        #19

                                        hi, try to change **main()** to **void main()** codito ergo sum

                                        T 1 Reply Last reply
                                        0
                                        • D David Crow

                                          BadKarma wrote:

                                          ...but most C++ compilers don't do this automatic translation.

                                          Visual Studio v6 handles this just fine. He is doing something else wrong as his code compiles fine as a .c file or a .cpp file. I suspect it's the type of project he chose.


                                          "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

                                          B Offline
                                          B Offline
                                          BadKarma
                                          wrote on last edited by
                                          #20

                                          DavidCrow wrote:

                                          Visual Studio v6 handles this just fine. He is doing something else wrong as his code compiles fine as a .c file or a .cpp file. I suspect it's the type of project he chose.

                                          When I tested the code i wrongfully pasted the code in a .cpp file which led to the unresolved error which I mentioned. I do however used VS2005 to test. When renamed to a .c file everything compiles and links without a problem. Sorry to add up the confusion :) codito ergo sum

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups