Thread: 5 times "local function definitions are illegal"

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Borislav View Post
    I'm using Microsoft Visual C++ 6.0, with virtual CD - any problems here ?
    Extremely.

    In the newest version Microsoft Visual C++ 2010 Express I can't understand how to start the program and compilator.From Microsoft should make it simplier.
    I don't see what's so difficult. Start Microsoft Visual Studio 2010. Load your solution / project (file -> open). Or create a new one (file -> new, and remember to choose console / windows project, and nothing else). Then compile using build solution.

    In Turbo C version I haven't tried my program due to the COPY-PASTE problem and I don't want to write it again.
    Even more problematic. Turbo C is radioactive waste that should have been locked away forever many years ago.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Jan 2011
    Posts
    13
    Quote Originally Posted by Elysia View Post
    Extremely.


    I don't see what's so difficult. Start Microsoft Visual Studio 2010. Load your solution / project (file -> open). Or create a new one (file -> new, and remember to choose console / windows project, and nothing else). Then compile using build solution.



    Even more problematic. Turbo C is radioactive waste that should have been locked away forever many years ago.

    I can't see build solution anywhere :
    ImageShack® - Online Photo and Video Hosting

    At the university we are using Borland C and Borland Pascal and I used to work in these programs. That's why it's hard in the newest.
    Last edited by Borislav; 01-05-2011 at 11:31 AM.

  3. #18
    Registered User
    Join Date
    Jan 2011
    Posts
    13
    Salem thank you for your comments.
    I'll pay attention

  4. #19
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The build menu appears between the Project menu and the Debug menu, but it only appears when you have something worth building. Visual Studio will not just compile a file as a file, you must make a project.

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Borislav View Post
    I can't see build solution anywhere :
    ImageShack® - Online Photo and Video Hosting

    At the university we are using Borland C and Borland Pascal and I used to work in these programs. That's why it's hard in the newest.
    You haven't opened / created a project. That is why you see nothing.
    You have merely opened a file, which won't do.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #21
    Registered User
    Join Date
    Jan 2011
    Posts
    13
    OK, thank you.

    I don't want to start a new topic, so here I'll post my questiong regarging the program.
    Code:
    	while(NOMER!=0) 
    			{	
    				cout << "\n                       NOMER :"; 
    				cin>>NOMER; 
    				cout << "\n                       VALUE: ";
    				cin>>pol;
    				addTREE(NOMER, root1); 
    				} 
    			continue;
    That can I do so after the value of "NOMER" is "0", not to show the "\nVALUE: ";
    message in the program ? I have a condition, but it shows it yet.

  7. #22
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Borislav View Post
    OK, thank you.

    I don't want to start a new topic, so here I'll post my questiong regarging the program.
    Code:
    	while(NOMER!=0) 
    			{	
    				cout << "\n                       NOMER :"; 
    				cin>>NOMER; 
    				cout << "\n                       VALUE: ";
    				cin>>pol;
    				addTREE(NOMER, root1); 
    				} 
    			continue;
    That can I do so after the value of "NOMER" is "0", not to show the "\nVALUE: ";
    message in the program ? I have a condition, but it shows it yet.
    After you read in NOMER, you should check right then whether or not it's zero. Checking four lines later, after you've already done some other stuff, doesn't help.

  8. #23
    Registered User
    Join Date
    Jan 2011
    Posts
    13
    Well, I understand you but I can't do it properly.

    My ideas are here in "pole"
    every element to be firstly "1"
    Code:
    struct ELEM {
        int key2, pole;
        ELEM *left, *right;
    } *root1, *root2;
    After I make some changes(from the tree to send an element in a queue), "pole" must become '0' ( I have a function called "Available" which makes "pole" equals to "0" .

    -----------

    I've tried check right after NOMER but ..

    Code:
    	while (NOMER!=0) 
    			{ 
    				cout << "\n                       NOMER :"; 
    				cin>>NOMER;  
    				if (NOMER=0) // here is the check, but not very usable 
    					break;				else 
    				{
    					cout << "\n                       VALUE: ";
    					cin>>pol;
    					addTREE(NOMER, root1); 
    				}
    			
    			}
    			continue;
    EDIT : Is it possible pole to be empty and "0" if the tree is in queue ?
    Last edited by Borislav; 01-09-2011 at 02:07 AM.

  9. #24
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    There is a difference between NOMER=0 and NOMER==0. You should always make sure you're using the right one for the job. (And you should listen to your compiler, when it says things like "using assignment value for if-condition".)

  10. #25
    Registered User
    Join Date
    Jan 2011
    Posts
    13
    hey guys,

    I'm facing another problem.


    First I add elements in a binary tree :

    Code:
    while(NOMER1!=0)
                { 
    				cout << "\n				Landed airplane :";	
    				cin>>NOMER1;
    				addTREE(NOMER1, root2);;
                    
    			} 
    			continue;
    While creating the tree, I do this in the function :

    Code:
    t->pole = "IN TREE"

    After I make a tree, elements can be sent in queue :


    Code:
    while(k!=0)
    			{
    
    			cout << "\n					Airplane for landing : ";
                cin >> k;
    		            if(search_iter(root1, k)!=NULL) 
    			{
    				push(k);
    				Available(root1, k); 
    			}
    			}
    			continue;
    And it's supposed "AVAILABLE" to change the "pole" cell from "IN TREE" to
    "IN QUEUE".

    void Available(ELEM * t, int n) {
    if (t != NULL) {
    t->pole = "IN QUEUE";
    Available(t->left, n);
    Available(t->right, n);
    }
    }

    but unfortunately it changes EVERY "pole" cell from the tree.


    Any ideas how can I change "Available" so to change only particular elements's "pole" cells ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  5. help writing function definitions
    By jlmac2001 in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2003, 09:44 PM