Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
Compiler Problem!?!?

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Compiler Problem!?!?

    Well,
    I made some Programs now and after a while my compiler(MSVS2005Pro) was set wrong I think. If I compile now and run the Program it run through the Program without stoping in 1 sec. After the Program I even had to push any button I want to end. But know it end itself...
    Here an example:
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    	for(int i=1;i<=10;++i)
    	{;
    		cout<<i<<endl;
    	};
    }
    This Program should display the numbers from 1 until 10. Well it do but on my compiler so fast that I cant see it Click for see my compiled file
    What to do to fix that Problem?

  2. #2
    VIP null's Avatar
    Join Date
    Apr 2006
    Posts
    1,796

    Re: Compiler Problem!?!?

    add to the bottom (above } ) the line system("PAUSE"); return 0;


  3. #3
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Compiler Problem!?!?

    Thank you it work
    Even good support on this site.
    Btw even return 0; ? What the 0 stand for?

  4. #4
    dM
    dM is offline
    Junior Member dM's Avatar
    Join Date
    Jun 2007
    Posts
    13

    Re: Compiler Problem!?!?

    it means you are returning a value of 0 (or null) because you have no arguments in your main function.

    if you had something like

    void main(int a, int b, int c)

    you would need to return those values at the end of your function.

  5. #5
    VIP null's Avatar
    Join Date
    Apr 2006
    Posts
    1,796

    Re: Compiler Problem!?!?

    void main(int a, int b, int c)

    you would need to return those values at the end of your function.
    Well, there you wouldnt need to return anything because its a void. But if it was int, you have to return an integer. Float, return a float, char, return a char, etc.


  6. #6
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Compiler Problem!?!?

    Ok I think I understood...
    Now I know some kinds of Places where to save Variables: int(1,2,3,4,5), float(3,123), double(3,5817930), string(letters), unsigned(for positve numbers), signed(dunno ), short & long.
    But what is void

  7. #7
    VIP null's Avatar
    Join Date
    Apr 2006
    Posts
    1,796

    Re: Compiler Problem!?!?

    void means nothing.. so no return value.


  8. #8
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Compiler Problem!?!?

    ok
    If void mean nothing why write it?

  9. #9
    VIP null's Avatar
    Join Date
    Apr 2006
    Posts
    1,796

    Re: Compiler Problem!?!?

    its a symbol that means it will return nothing. For example, in functions:

    Code:
    int add(int a, int b)
    {
     return a+b;
    }
    when you say cout << add(5, 5) << endl; it will print "10". Sometimes, you dont need to return a value, such as:
    Code:
    void add(int a, int b)
    {
      cout << a + b << endl;
    }
    So you can simply say add(5,5); and not worry about returning a useless value


  10. #10
    Site Admin xHalt's Avatar
    Join Date
    May 2006
    Location
    Belgium
    Posts
    8,202

    Re: Compiler Problem!?!?

    Quote Originally Posted by SilenT
    ok
    If void mean nothing why write it?
    void means the method that is void won't return any value.

    for instance:
    public void setQuantity(5){...
    If the method is executed, it will alter a certain value, but won't return any value.

Page 1 of 2 12 LastLast

Similar Threads

  1. Where can i find a C++ Compiler?
    By Refa in forum Beginner
    Replies: 8
    Last Post: March 1st, 2011, 10:28
  2. Best Compiler
    By foozle in forum Basics
    Replies: 7
    Last Post: December 15th, 2008, 23:51
  3. All compiler errors
    By idolize! in forum Tutorials
    Replies: 4
    Last Post: June 27th, 2008, 14:11
  4. New Bloodshed Compiler
    By Zero in forum Software
    Replies: 2
    Last Post: August 20th, 2007, 05:40
  5. Nexus 0.42 compiler
    By AdawolfA in forum Enemy Territory Cheats
    Replies: 12
    Last Post: April 11th, 2007, 15:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •