Page 19 of 21 FirstFirst ... 91718192021 LastLast
Results 181 to 190 of 201

Thread: Programming Language

  1. #181
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pcbrainbuster View Post
    I just wanted to know how to add images and sound using C++...
    From what I recall of this thread (I'm not going to re-read it), you've been told repeatedly.

    For example IE is probably mostly C and yet using scripts and what not you can add images, sound and animation.
    Yes, by calling predefined code that renders these things. In the case of IE, it'll use the Win32 API. However, other interfaces can be used instead (such as wxWidgets and Qt, which have been mentioned numerous times).

    And C++ is basically C but with improvements
    No, it isn't. C++ is largely, but not totally backwards-compatible with C, but that's all that should be said on the subject.

    and you should be able to see why I keep asking the same question...
    And, frankly, I'm tired of answering it.

    If a program is built to run in a graphical environment (such as Windows), then of course it can create graphical elements.

    At least in Windows, a console program is simply software that causes the OS to create a console. GUI-based programs are essentially the same thing, minus the console.
    You do realize I was talking about the console itself in a graphical environment all this time right?
    Yes, your point? You shouldn't be looking at interacting with the graphical subsystem yet. Learn the language, first.

    2) Is Windows Live Messenger completely C?
    I would have expected it to use a .NET language.

    I am asking this because I like its features such as 'remote desktop' and 'live message sending' and would one day like to do the same thing in a different way...
    This has nothing to do with the language used to write the software.
    Mike

  2. #182
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well I'm sorry for my troubles but please try to bare with me, understand that I am a 13 year old who walks around with a undeveloped brain, ie zombie ...

    edit - What is wrong with my test? -

    #include <iostream>
    using namespace std;

    class multiplicate
    {
    public :
    int x, y, z;
    multiplicate(int num)
    {
    x=num*10;
    y=num*100;
    z=num*1000;
    }

    ~multiplicate() {}
    }

    int main()
    {
    int contin=1;
    int number=0;
    while(contin!=0)
    {
    cout << "Write down a number that will be multiplicated by 10, 100 and 1000 times respectively - ";
    cin >> number;
    cout << "\n\n";
    multiplicate act(number);
    cout << "\n\nDo you want to start again? 1 for yes and 0 for no -";
    cin >> contin;
    }
    return 0;
    }

    Thanks.
    Last edited by pcbrainbuster; 06-16-2007 at 11:57 PM.

  3. #183
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pcbrainbuster View Post
    edit - What is wrong with my test? -
    When asking for help debugging, always state what you expect to happen, as well as what you observe (or don't). If we don't know what code is meant to do, we cannot tell you why it's not doing it!

    Code:
    class multiplicate
    {
    public :
        int x, y, z;
    Classes should exhibit encapsulation: data members should not be public. Whilst this isn't a rule, public members should be considered exceptional.

    Code:
        multiplicate(int num)
    If a variable can be reasonably declared const, do so. Not only can it help serve as documentation (such a variable is clearly not meant to change) and aid in debugging (a compiler will issue a diagnostic if an attempt is made to change a constant), but certainly with references, if an argument isn't declared constant, constant values cannot be passed even though no attempt will be made to change them.

    Going back to the template example I gave earlier in the thread, for instance, provides a demonstration:

    Code:
    template <typename T>
    const T& min(const T& a, const T& b) {
        return (a < b) ? a : b;
    }
    If all of the const keywords were removed and one were to pass constants as arguments, the program wouldn't compile. As it is, the function will accept both constant and mutable arguments.

    Code:
        ~multiplicate() {}
    There's not much point in defining a destructor if it doesn't do anything (virtual destructors, aside).
    Mike

  4. #184
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Yeah but your just not seeing the point... Google is good but in the end there is always something that the author will miss out...
    That's why they're SEVERAL pages of results, meaning SEVERAL authors.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #185
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    and when searching for such general/basic questions, there will likely be many more than just several pages.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #186
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    My suggestion: drop C++, it's incredibly tough to learn the way you're trying to.
    Python, with the wxPython widget is absolutely incredible.
    This is an "image" script for a wxPython script which works on all platforms.
    Code:
    import wx
    class Image(wx.Dialog):
        def __init__(self, parent, id, title):
            wx.Dialog.__init__(self, parent, id, title)
            bmp = wx.Image("image.png", wx.BITMAP_TYPE_PNG).ConvertToBitmap()
            wx.StaticBitmap(self, -1, bmp, (5,5))
    
    class Run(wx.App):
        def OnInit(self):
            dlg = Image(None, -1, "Image Script")
            dlg.ShowModal()
            dlg.Destroy()
            return True
    
    app = Run()
    app.MainLoop()
    You'll need Python:
    http://www.python.org/

    and wxPython:
    http://www.wxpython.org/
    - Mike

  7. #187
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    - Mike

  8. #188
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've done to much toquit now really, but since the last time I actually talked about anything I have learnt a few more things - classes (finally), constructors and destructors. But only the basics...

    I'm gonna try and golearn what these things called templates are...

    edit - I just realized that I do not need to learn tmplates yet and am finding something else to look up. I think I remember somthing about up-casting by mwinter and now will look it up...

    edit - Again omething which I should learn later. I think I should build up my knowlegde of classes more...
    Last edited by pcbrainbuster; 06-19-2007 at 08:34 PM.

  9. #189
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by pcbrainbuster View Post
    I think I remember somthing about up-casting by mwinter and now will look it up...
    When I mentioned up-casting, the concept that I was actually considering was down-casting. Up-casting is safe, down-casting is not.
    Mike

  10. #190
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well I'm too confused for that I havn't quite learned anything about up/down-casting...

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
  •