void Intro()

This is a discussion on void Intro() within the C Programming forums, part of the General Programming Boards category; Code: The way we use void intro() in c++, can we use it in first page of a project in ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    9

    void Intro()

    Code:
    The way we use void intro() in c++, can we use it in first page of a project in c 
    language? I made a project, and tried to add 'void intro() {.....}' but it doesn't
    work. If it can't be used, tell me some alternate that I can use in c language
    project to make a main introduction page.
    
    #include<stdio.h>
    #include<conio.h>
    #include<string.h>
    #include<dos.h>
    void intro()
    {
    clrscr();
    textcolor(5+BLINK);
    printf("\n******....
    ................ 
    ..................
    delay(500);
    }
    struct student
    {
    char phno[12];
    char amt[7];
    char na[30];
    char addr[30];
    char act[20];
    char ano[10];
    }s1;
    char x,loan;
    void getdata()
    {
    clrscr();
    textcolor(GREEN);
    printf("\n E...........
    ....................
    }

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    C console programs start with either

    int main (void)

    int main (int argc, char *argv[])

    and return an integer value at the end (usually 0 for success or an errorcode on failure).


    But I do have to ask exactly how old your compiler/computer is if you are including dos.h...

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    9
    My pc is around 4 years old and my compiler is version 3, turbo c++.
    void main is already present somewhere below in the program.
    and it giving error: multiple declaration for 'main'
    Last edited by Inderjeet; 07-05-2011 at 02:01 PM.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Inderjeet View Post
    My pc is around 4 years old and my compiler is version 3, turbo c++.
    You're gonna get put through the mill about using turbo c++ ... it is roundly disliked around these parts and for good reasons.

    If you're doing C and C++ look into MinGW based compilers such as the one that comes with Code::Blocks

    If you're doing pure C your best bet is Pelles C which is a C-99 standards based compiler for both x86 and x64.

    What I think you'll find is that Turbo C and Turbo C++ are so badly outdated as to be nearly useless in today's coding environments.

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    9
    Ok, i would like to install a free version, but I want to to run this project by tomorrow, so i am in little hurry, to run it in present compiler.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Inderjeet View Post
    void main is already present somewhere below in the program.
    and it giving error: multiple declaration for 'main'
    void main () is not valid in standards based C. Another reason to get rid of Borlands abandoned babies.

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Inderjeet View Post
    Ok, i would like to install a free version, but I want to to run this project by tomorrow, so i am in little hurry, to run it in present compiler.
    Both of my recommendations are free.

  8. #8
    Registered User
    Join Date
    Jun 2011
    Posts
    9
    My project will be checked in on same turbo c++ compiler. So I have to edit it according to my present compiler.
    So is there some alternative in C language how i can make an introduction page?
    So far nothing helped me to my problem's solution, as I want it compiled by tomorrow.
    Last edited by Inderjeet; 07-05-2011 at 02:18 PM.

  9. #9
    Registered User
    Join Date
    Jun 2011
    Posts
    9
    I am thinking to make a different program for introduction, as I will give it in a CD. Can u suggest me what I can put in my introduction page?
    ****************PROJECT NAME****************


    My Name:-----
    MY Email:-----------
    MY Guide:--------(Teacher and institute name)------





    Any more suggestions what I can put in intro page?
    ty.
    Last edited by Inderjeet; 07-05-2011 at 02:50 PM.

  10. #10
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Intro pages can be simply a function called from main and displayed with printf()... there's no need for anything specialized or fancy...

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    
    void Intro (void)
      { printf("This is my intro page\n");
         printf("I made it just for you\n");
         //  and so on
    
        getchar();
       }
    
    int main (void)
      { // variables
    
         Intro();
        
        // rest of code
    
        return 0; }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 03-27-2009, 03:36 PM
  2. is C appropriate for intro to computers?
    By nonoob in forum A Brief History of Cprogramming.com
    Replies: 213
    Last Post: 10-15-2008, 06:31 PM
  3. Intro + help
    By D2k204 in forum C++ Programming
    Replies: 4
    Last Post: 07-30-2007, 03:17 PM
  4. Intro to C++, NEED HELP!!!
    By romeoz in forum C++ Programming
    Replies: 14
    Last Post: 06-11-2003, 09:19 PM
  5. Best resource for intro to C?
    By Fool in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 08-31-2001, 01:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21