Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jun 4th, 2005, 2:51 PM   #1
Insomniac
Programmer
 
Insomniac's Avatar
 
Join Date: Aug 2004
Location: Cloud #9
Posts: 47
Rep Power: 0 Insomniac is on a distinguished road
(SOLVED)It's giving me "Press any key to continue" and no other output..

I got this from About.

  #include <stdio.h>
  
  int main()
  {
  	int luckyNumber = 5;
  	float radius = 2;
  	char myName[15] = "John";
  	char initial = 'J';
  	
  	printf( "Hellow World!\n" ); /* the format string contains only o
 							 ordinary characters. Ordinary characters 
 							 are output unmodified.
 							 A character string in C is of type
 							 "char *".*/
  	
  	printf( "My lucky number is %d\n", luckyNumber ); /*The "%d" specifies
 							 that an integer value will be output.*/
  	
  	printf( "My name is %s\n", myName ); /* The %s specifies that a character
 							 string will be output.*/
  	
  	printf( "My first initial is %c\n", initial ); /*The %c specifies that a
 							 character will be output.*/
 							 
  	printf( "The area of a circle with radius %f is %f\n", radius, 3.14* radius*radius );
 								 //%f specifies that a float will be output
  	
  	printf( "Hello %s or should I say %c\n", myName, initial );
 							 //multiple arguments of different types may be output.
  	
  	getchar();
  	return(0);
  }

I realize there should be output with this program. I tried adding #include <iostream> and using namespace std; and changed all the printf to cout's with no success. After that I looked for grammatical errors. Then I used Google with the keyword "Press any key to continue" and even added "learning programming"(only not in quotes) to it. Nothing. I then did a search of the forums here and also found nothing. It seems like it should simply output something and I can't understand why.

Side note: My compiler occasionaly acts funny; freezing up, running high, rewriting words for me. I checked the help file and index and I have no clue why it's doing this.

Please help.

EDIT: Thanks you guys for the help. Ill attempt the database search and get the other version of DevC++ that DaWei suggested. Im not going to get too involved as my experience in this is low AND Ill be receiving a new system shortly, thus Ill put more effort into the new rig. I appreciate it.

Thanks.
__________________
From an IBM Thinkpad T43 - 14.1" SXGA+ - ATI 64 MB X300 - Sonoma 760 - 2 GB RAM - 80 GB HD 5400 - IBM ABG II - FC3, Ubuntu & XPee
DevC++, and Macromedia's - Dreamweaver & Flash Pro and a little Adobe Illustrator & Photoshop
Sleep? Sleep is for the weak.:cool:


Last edited by Insomniac; Jun 6th, 2005 at 5:05 PM.
Insomniac is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC