Thread: how to create a new enter.....?

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    3

    how to create a new enter.....?

    alright so im doing this small project for class and i want to add some c programming to it but im getting stuck. I dont know if what im asking is even possible but bear with me.

    Here is the code i have so far:

    Code:
     #include <stdio.h>
    main()
    {
    	printf("hey whatsup guys\n");
    	printf ("\n");
    	printf("I just want to talk to you guys guys real quick about my experiences before and after middle college\n");
    	printf("\n");
    	printf("and how middle college changed me\n");
    }
    Basically what i want to do is when i execute the program i dont want 3 printf lines to come on at once. I want to be able to press enter and then the next printf line comes along so basically:

    printf("hey whatsup guys\n");
    ENTER
    printf("I just want to talk to you guys guys real quick about my experiences before and after middle college\n");

    how would i do this and is it even possible?

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    getchar();

  3. #3
    Registered User
    Join Date
    May 2011
    Posts
    3
    so i would add that in between each line?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Well... yep. You could try that.

  5. #5
    Registered User
    Join Date
    May 2011
    Posts
    3
    YAY it worked you are the best man thank you!!!!!!!!! freaking life saver

  6. #6
    Registered User
    Join Date
    Dec 2010
    Location
    Lucknow, India
    Posts
    72
    you can also try getch();
    There is a Real magic in enthusiasm, It spells the difference between mediocrity and accomplishments.

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Gaurav Singh View Post
    you can also try getch();
    Yes he can... but it's not standard C. It's in conio, so he might not have it.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by dapalipro View Post
    YAY it worked you are the best man thank you!!!!!!!!! freaking life saver
    Now, just one question... whey did you have to ask how to use it... why not just go ahead and try it to see what happened.

    One of the very best ways to learn C is "trying stuff"...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. create and populate create bidimensional array
    By darkducke in forum C Programming
    Replies: 0
    Last Post: 12-03-2010, 07:06 AM
  2. Replies: 9
    Last Post: 02-22-2009, 11:50 PM
  3. the enter key
    By Amyaayaa in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2008, 04:06 AM
  4. Enter?
    By alexnb185 in forum C Programming
    Replies: 9
    Last Post: 08-13-2007, 01:54 PM
  5. value of enter key
    By n3v in forum C++ Programming
    Replies: 1
    Last Post: 05-29-2006, 02:52 AM