Search:

Type: Posts; User: Diablo84

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,272

    Thank you for the information. >> I also...

    Thank you for the information.

    >> I also assume that you cannot assign a value to an enumeration.

    Sorry, i phrased that badly, i was thinking along the lines of mycolor = "value"; But i guess...
  2. Replies
    5
    Views
    1,272

    Understanding Enumerations

    Having had trouble understanding enumerations, i decided to have a brief trial and error session with my compiler to observe how they work.



    enum colors {red,yellow,green,brown,blue,pink,black}...
  3. Replies
    6
    Views
    2,958

    Thank you everyone.

    Thank you everyone.
  4. Replies
    6
    Views
    2,958

    I am working on Windows XP (with Bloodshed...

    I am working on Windows XP (with Bloodshed Dev-C++ if that is relevant)
  5. Replies
    6
    Views
    2,958

    Setting the console title

    How do you set the title of the console window?

    I have had a search but cannot find anything on it.

    Thank you.
  6. Replies
    3
    Views
    4,405

    Thank you, i hadn't expected associative...

    Thank you, i hadn't expected associative arrays... or maps, to be available so that's an added bonus.
  7. Replies
    3
    Views
    4,405

    "Implode" an Array

    Does C++ have a function similar to the PHP function, implode?

    For example:



    $var = implode('|',$thearray);


    Which would join the array values together in a string with the | character...
  8. Replies
    11
    Views
    2,686

    Needless to say, anything like that is beyond me...

    Needless to say, anything like that is beyond me at the moment. I feel better knowing what's happening to cause the large file size.

    I figure it makes more sense to question everything now rather...
  9. Replies
    11
    Views
    2,686

    For me it's simply a case of "out of interest",...

    For me it's simply a case of "out of interest", rather then it being an important issue. I couldn't understand why the executable was nearly half a meg in size when there was a relatively small...
  10. Replies
    11
    Views
    2,686

    Thank you ... and sorry, should have...

    Thank you




    ... and sorry, should have tried the search first :\
  11. Replies
    11
    Views
    2,686

    Reducing the size of compiled file

    Hi,

    As a learning curve i wrote a very simple console program. The compiled executable for this is about 460kb. It seems that anything from a few lines of code to 100 or more is still around 460kb...
  12. Thank you all for the input, the use of strings...

    Thank you all for the input, the use of strings in C++ is much clearer to me now.



    The use of arrays wasn't a problem as my previous experience with PHP covered the theory side of things...
  13. Thank you, using the array version for strings...

    Thank you, using the array version for strings was a little inconvenient so it was quite relieving to find out there was a string type available in C++.

    Is there any common occurrences when a char...
  14. Strings - char mystring[n] vs. string mystring

    hi,

    While working through various tutorials, the method of using strings in C++ has been to use an char type array, eg:

    char mystring[10];

    or

    char mystring[] = "the string";
  15. Thread: Minor Problem

    by Diablo84
    Replies
    5
    Views
    989

    Thank you =) I wasn't aware you could set a...

    Thank you =)

    I wasn't aware you could set a variable as type string, i had thought you could only use an array with char arr[n] in c++.
  16. Thread: Minor Problem

    by Diablo84
    Replies
    5
    Views
    989

    Minor Problem

    Hi,

    I have just been rounding off learning the basics of working with C++ at the console level by coding a very simple game. Part of this entails opting to play the game again.

    Basically, i if...
  17. Replies
    3
    Views
    1,211

    Thanks =)

    Thanks =)
  18. Replies
    3
    Views
    1,211

    Importance of...

    Two simple things...

    1. Is it important to include

    return 0;

    in int main()?

    As i understand this tells the program that it has executed successfully however it doesn't seem necessary (in...
  19. Replies
    22
    Views
    2,219

    I have just been doing some reading on why it's...

    I have just been doing some reading on why it's advisable to avoid goto. Initially i got the impression that it was just taboo but for no specific reason. After digging a little deeper i found it's...
  20. Replies
    22
    Views
    2,219

    Thank you. Could you confirm i have understood...

    Thank you.

    Could you confirm i have understood this line correctly from the FAQ:



    if ( scanf ( "%d", &num ) != 1 )


    The condition is that scanf did not successfully read one item and
  21. Replies
    22
    Views
    2,219

    Advice on basic number validation

    I have been experimenting with basic number validation and i need a little advice...



    #include <iostream>

    using namespace std;

    int main() {
    int num;
  22. Thank you 7stud, the behaviour of the code makes...

    Thank you 7stud, the behaviour of the code makes perfect sense now.

    I can't tell you how useful an explanation like that is when you begin learning C++, thanks again.
  23. Thank you both, very useful tip major_small. ...

    Thank you both, very useful tip major_small.

    Much appreciated.
  24. cin.get(); doesn't seem to be working as expected

    Hi,

    In the past few C++ examples i have worked through i have used cin.get() to wait for the enter key to be hit before the console window is closed (so code output can actually be observed before...
  25. Replies
    5
    Views
    993

    Thank you for the information 7stud, that...

    Thank you for the information 7stud, that explains the behaviour of my original code.

    On the bright side, a mistake made leads to a lesson learned.
Results 1 to 25 of 27
Page 1 of 2 1 2