CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Nayan Goenka

    MemberAug 28, 2013

    There are many reasons as to why the graphics command might not be working. did you include graphics.h in your code. Also can you post which errors you get so that we get a better picture.
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 28, 2013

    here's my code :


    Untitled
    Are you sure? This action cannot be undone.
    Cancel
  • Nayan Goenka

    MemberAug 29, 2013

    This error seems to be generated due to bad header file. You can try by doing one change here. Change int main() to void main() and remove the return line. I hope this one works. If not, then the header file isnot meant for devcpp. You can try turbocpp
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 29, 2013

    Nayan Goenka
    Change int main() to void main() and remove the return line.
    I tried it before but it again generates an error as "iostream.h header file not found".So this option doesn't work.
    You can try turbocpp
    no chance I've already given up with that compiler .😡👎
    Isn't there anything else that can be done.I've tried googling but seems of no help.
    whereas the earlier header file that I had downloaded throws an error as sstream header file not found .😔
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberAug 29, 2013

    shailaja revathi
    I tried it before but it again generates an error as "iostream.h header file not found".So this option doesn't work.

    no chance I've already given up with that compiler .😡👎
    Isn't there anything else that can be done.I've tried googling but seems of no help.
    whereas the earlier header file that I had downloaded throws an error as sstream header file not found .😔
    I don't think dev supports graphics.h
    however try Downloading the BGI library and try linking with your project.. that might give you some help!
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 29, 2013

    Vishal0203
    I don't think dev supports graphics.h
    however try Downloading the BGI library and try linking with your project.. that might give you some help!
    I've already done that .
    Are you sure? This action cannot be undone.
    Cancel
  • Nayan Goenka

    MemberAug 29, 2013

    Well it seems all the issues you are facing is basically due to the compiler fault. There is nothing you can do to fix it.

    There is a error i just noticed in your code. As i said use the void main()

    And correct the first line to.
    #include<iostream.h>

    The .h seems missing. Maybe it can resolve. If it still doesn't work then you know the answer already, Change compiler, try some other one.
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    Nayan Goenka
    Well it seems all the issues you are facing is basically due to the compiler fault. There is nothing you can do to fix it.

    There is a error i just noticed in your code. As i said use the void main()

    And correct the first line to.
    #include<iostream.h>
    Actually dev-cpp doesn't allow the use of <iostream.h>.It throws an error on using it as 'iostream.h' header file not found .And hence I cannot use void main() as it's not a good programming practice and also not supproted in dev-cpp and most standard versions(I'm using dev-cpp version 5.4.1).
    And I'm googling for another compiler meant for graphics functions but you know it's difficult to decide which one would be best ,I'm mean I don't want some outdated old versions ,I wanna try new softwares .Well what is Cygwin ,I mean I know that it provides linux like environnemnt on windows system but is it efficient to be used and please do recommend if you know of some other compiler for Windows 7 32-bit .
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberAug 30, 2013

    shailaja revathi
    Actually dev-cpp doesn't allow the use of <iostream.h>.It throws an error on using it as 'iostream.h' header file not found .And hence I cannot use void main() as it's not a good programming practice and also not supproted in dev-cpp and most standard versions(I'm using dev-cpp version 5.4.1).
    And I'm googling for another compiler meant for graphics functions but you know it's difficult to decide which one would be best ,I'm mean I don't want some outdated old versions ,I wanna try new softwares .Well what is Cygwin ,I mean I know that it provides linux like environnemnt on windows system but is it efficient to be used and please do recommend if you know of some other compiler for Windows 7 32-bit .
    there is no relation between iostream header and error in declaration of main().
    Dev c++ take cares that you don't follow the wrong standards and hence it doesn't allow you to use void main() as it is a bad practice! Use int main() instead! there are reasons behind these things.
    Are you sure? This action cannot be undone.
    Cancel
  • Nayan Goenka

    MemberAug 30, 2013

    Well if you are asking me for a good compiler I would still suggest Turbo C++ which comes in DosBox. It is what I use myself. But I am not a hard core C programmer so it doesn't matter to me directly. I didn't do graphics in C so I dont know much of this. You seem more into C. Good luck in finding a good compiler. What are you trying to build with graphics btw? is it only some testing and exploring or some serious development you are doing.
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberAug 30, 2013

    shailaja revathi
    I'm using Dev-cpp .Inorder to run graphics command in dev-cpp I included graphics package and bgi files in dev-cpp.But still I'm not able to run graphics command as it throws errors.
    Hi there😀! good to know u are not using turbo C compiler, but then why are u using old bgi library? I would recommend u to use Opengl in DevCpp.
    Or if u want to simply use windows and stuff, without drawing lines and rectangles stuff, u can try ur hands on Windows Programming, (It would be a little difficult but adventurous 😉).
    Finally if u still direly wanna do using bgi here is a link I found <#-Link-Snipped-#> hope it helps.
    If u want to try another compiler, u can try Visual C++ , its a bit heavier but worth's a shot.
    Good Luck Programming!👍
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    Vishal0203
    there is no relation between iostream header and error in declaration of main().
    Dev c++ take cares that you don't follow the wrong standards and hence it doesn't allow you to use void main() as it is a bad practice! Use int main() instead! there are reasons behind these things.
    Actually in Dev-cpp :
    #include<iostream>
    using namespace std;
    So use of main() with return type of int is supported instead of void and hence there is probably a relation with iostream header and main()'s retrun type.
    This is what I meant and I'm used to using int main() atleast at home.
    Anyway all this stuff I'd learnt from your previous posts in regard to c++ programming tutorials and inspired by that I'm prefering this awesome compiler dev-cpp(atleast better than turbo c).😛
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    Nayan Goenka
    You seem more into C. Good luck in finding a good compiler. What are you trying to build with graphics btw?
    Actually we have computer graphics practical in c and I don't get enough to learn from turbo-c dos-box in colg due to limited time .Previously I had been using dos-box but it didn't have full screen view and behaved erratically and it seemed a bit tedious to handle it.
    [/is it only some testing and exploring or some serious development you are doing.QUOTE]
    Only testing and some explorations.
    no ,only testing and exploring .No opportunity, and time as well, to do some serious development.
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    rahul69
    Hi there😀! good to know u are not using turbo C compiler, but then why are u using old bgi library? I would recommend u to use Opengl in DevCpp.
    Or if u want to simply use windows and stuff, without drawing lines and rectangles stuff, u can try ur hands on Windows Programming, (It would be a little difficult but adventurous 😉).
    Finally if u still direly wanna do using bgi here is a link I found <#-Link-Snipped-#> hope it helps.
    If u want to try another compiler, u can try Visual C++ , its a bit heavier but worth's a shot.
    Good Luck Programming!👍
    Thanks for the link it solved some of my problems regarding sstream error.
    Will try others also.😀
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberAug 30, 2013

    shailaja revathi
    Thanks for the link it solved some of my problems regarding sstream error.
    Will try others also.😀
    I researched on a few things. I think you should go with Code Blocks EP version which has winbgim inbuilt in it...
    I tested the code what you have written above!
    works fine!
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberAug 30, 2013

    A copied program!!
    executed in code blocks EP
    gives the output as the attached image! 😀
              #include <graphics.h>
              #include <conio.h>
    
              int gdriver = DETECT;
              int gmode;
    
              main()
              {
                  struct fillsettingstype saveset;
                  int pat, clr;
    
                  initgraph(&gdriver,&gmode,"");
                  for (pat = 1; pat < 12; pat++)  {
                      for (clr = 1; clr <16; clr++) {
                          setfillstyle(pat,clr);
                          pieslice(100,100,0,134,49);
                          getch();
                      }
                  }
                  closegraph();
              }
    
    
    
    Untitled
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    Vishal0203
    I researched on a few things. I think you should go with Code Blocks EP version which has winbgim inbuilt in it...
    I tested the code what you have written above!
    works fine!
    Thanks downloading it now.Will try this too.
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberAug 30, 2013

    shailaja revathi
    Actually we have computer graphics practical in c and I don't get enough to learn from turbo-c dos-box in colg due to limited time .Previously I had been using dos-box but it didn't have full screen view and behaved erratically and it seemed a bit tedious to handle it.
    If that's the case , here is an awesome solution to ur problem:
    #-Link-Snipped-#
    Good Luck! 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Shailaja Tiwari

    MemberAug 30, 2013

    rahul69
    If that's the case , here is an awesome solution to ur problem:
    #-Link-Snipped-#
    Good Luck! 😀
    Is it a freeware?
    Well I downloaded the software and works the same way as in college,i.e. fullscreen viewing .
    Thanks.😀😁
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register