Author Topic: No text?  (Read 3665 times)

QuackBastard

  • Guest
No text?
« on: October 09, 2014, 09:55:44 am »
I'm just learning c++

I made my first function. oh boi.
my code looks like this.

-----------------------------------------------------------------------
#include <iostream>
using namespace std;

void bleh()
{
    string a;

    cout << "input text" << endl;
    cin >> a;
    cout << "thanks, ho. bye bye now." << endl;

}
int main()
{
    void bleh();
    return 0;

}
------------------------------------------

I build and run it, and the console looks like this:
------------------------------------------------------

Process returned 0 <0x0>         execution time : 0.016s
Press any key to continue.
------------------------------------------------------


I made this based on a tutorial on youtube.

I stared at this for 3 hours, trying to find out what I did wrong, and nothing. I did it the exact same way the guy in the video did.
Why is none of the text showing, when he did the same thing, and it worked perfectly?

No errors show in the build log. I'm using version 13.12, and the GNU GCC Compiler.

I wanted to post in the link they told me to, but I got the "page not found" error, so I apologize.

« Last Edit: October 09, 2014, 09:58:06 am by QuackBastard »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: No text?
« Reply #1 on: October 09, 2014, 10:03:50 am »
Please respect our forum rules !

When registring here you accepted to follow these rules.
In your case especially:

This post is here to assist you in your Code::Blocks / C++ blues, by telling you what NOT to do. This is not to frighten you, but unfortunately we have to be that strict due to continuous mis-use and dis-respect.

1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.

[...]

4. Search before you post. If you've used other IDEs and you're moving to Code::Blocks, try reading the Wiki (e.g. http://wiki.codeblocks.org/index.php?title=FAQ) at the homepage, and if you're confused on how to set up things, SEARCH THE FORUM. Probably the answer you're looking for is in there. Remember, Google is your friend :)

[...]

Thank you.

Finale note: Ignoring these rules may result in the topic being (silently) locked and/or even removed completely without any notice.

In case you wonder why we are so strict: I could say: "Search the forum" - as this has been discussed a lot. To make is short: By law we (the devs/moderators) are responsible for the content of our forum. This means we need to read all posts. If you want us to continue the development of C::B and have the time to answer some of the questions that are really related to C::B, apply the rules above. It's obviously a matter of time for us.

More general help how to use our forum you'll find here, too.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: No text?
« Reply #2 on: October 09, 2014, 10:14:40 am »
Anyway a hint here:
there is a difference between a function call and declaration.