Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

IDE not working for me!!


  • Please log in to reply
4 replies to this topic

#1 ashutoshrathore

ashutoshrathore

  • Members
  • 78 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ahmedabad,Guujarat,India
  • Local time:11:15 AM

Posted 24 October 2011 - 08:00 AM

Hey guys!! Need a little help...
My previous topic was 'Wanna learn C++' ...After getting source from replies i started to work out on C++ after reading introduction and all theory part of C++ i started to work on practical par i.e writing programmes.
So I used these two IDE or compilers
Turbo C++ 3.0
Bloodshed Dev C++
After writing simple programme i compiled it with 0 error and tried to run but in both the IDEs a black screen appeared for a sec and then nothing happens....I am confused what to do as the compiler shows 0 errors...
Heres the simple programme:
#include<iostream.h>
int main( )
{ 
  cout<< '' Hello C++ " ;
  return 0 ;
}

Please help me as soon as possible!!
ASHUTOSH RATHORE
Twitter




BC AdBot (Login to Remove)

 


#2 JosiahK

JosiahK

  • Members
  • 269 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:45 AM

Posted 24 October 2011 - 10:12 AM

Most terminal programs will simply exit as soon as the program finishes, you need some form of Pause, Sleep or Wait command to tell it to stick around for the user to acknowledge it. I don't use C family languages, so I can't tell you what that is off the top of my head.
Running the program from the command line also leaves the output on the screen because the console waits for the next command.

There's also a pretty obvious error in that code you've got there: you've tried to use two single quotes ('') instead of a double quotation mark("). That means that the text "Hello C++" isn't considered to be a string, whereas everything after the " (; return 0; }) is! I would suggest that color coding is one of the most useful features of an IDE since it reveals where such mistakes have been made. In your case everything coming out green is assumed to be text and not computer code.
Quod non mortiferum, fortiorem me facit.
I don't read minds. Please help everyone by answering any questions and reporting on the results of any instructions. Query any concerns and explain problems or complications.

#3 JosiahK

JosiahK

  • Members
  • 269 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:45 AM

Posted 24 October 2011 - 10:23 AM

The alternative is simply to put some form of input command in (I think it would be cin:get(); ), forcing the program to wait for the user to push a button.
Quod non mortiferum, fortiorem me facit.
I don't read minds. Please help everyone by answering any questions and reporting on the results of any instructions. Query any concerns and explain problems or complications.

#4 ident

ident

  • Members
  • 109 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Cambridge
  • Local time:01:45 AM

Posted 25 October 2011 - 01:46 AM

JosiahK is correct. If you want the console to remain open you need it to loop. I am also not a c man but converted "roughly" from vb.

Courtesy of Instant c++

public:
	void Main()
	{
		System::String ^command = nullptr;

		do
		{
			command = Console::ReadLine();

			if (System::String::Compare(command, "Quit", true) == 0)
			{
				break;
			}
			else
			{
				//Process command here.
			}
		} while (true);
	}


#5 ashutoshrathore

ashutoshrathore
  • Topic Starter

  • Members
  • 78 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ahmedabad,Guujarat,India
  • Local time:11:15 AM

Posted 31 October 2011 - 01:59 AM

Okay well i got that!!

thanks a lot...

The only thing i've to do is add ''getch'' function!!

:)
ASHUTOSH RATHORE
Twitter







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users