• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

c++ code not compiling in online compiler?

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys when i try to run this program, i get the correct output in c free compiler..but when i try to run it onlinein ideone, i get a run time error..please help me guys...


 
Marshal
Posts: 80096
413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please supply more details, including the name of the online compiler, in cased we need to avoid it
 
sinatra roger
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the problem was with using iostream.h where just iostream was needed also i had to use the statement using namespace std...

but now its giving a run time error...some non-standard memory allocation or something like that...the headaches of c++!! i would have implemented the same thing in java..but im still doing simple exercises by taking inputs through command line...im yet to learn how i can take inputs during run time....
by the way the name of the compiler is ideone.com..avoid unless you are using java
 
Campbell Ritchie
Marshal
Posts: 80096
413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have come across other online IDEs and have known them make errors in Java coding before.
 
Campbell Ritchie
Marshal
Posts: 80096
413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could get that IDE to work for FORTH, however. That’s better than I have seen before
 
sinatra roger
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
learning java paid off...i dont know if this code below is badly structured or has bad coding practices, but with the little knowledge i had,i was able to achieve the same thing in java..and the online compiler gave up and compiled..

 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This code portion is very suspicious. Where does word point to? How much memory is allocated to that "buffer"?
Where does gets(word) store the line?

 
bacon. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic