Search:

Type: Posts; User: swgh

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    5
    Views
    5,010

    Also find out the difference between using static...

    Also find out the difference between using static variable vs a global one.
  2. int main() Is another one too - the difference...

    int main()

    Is another one too - the difference is entirely compiler specific. For instance the LCC compiler will give a
    warning if the char* args version us used without explicitly giving the...
  3. Thread: Basic Questions

    by swgh
    Replies
    6
    Views
    3,097

    What could be wrong here?

    What could be wrong here?
  4. Replies
    9
    Views
    7,548

    OMG Two great community members - will be...

    OMG

    Two great community members - will be sadly missed. I remember them both fondly. Dave had an Avatar of a cat and I think he might of been a mod at one point. Adak was quite a seasoned poster...
  5. Main returns an integer. It's usually best to...

    Main returns an integer.
    It's usually best to explicitly assign variables a value before you use them to avoid any garbage values being calculated.
    Try not to use system call functions to pause the...
  6. Replies
    10
    Views
    10,106

    I used to have the "Dragon" probably one of the...

    I used to have the "Dragon" probably one of the oldest computers I owned back then. I've been through a fair few, here's my list:

    Binatone
    Dragon
    Spectrum Z86
    C64
    Amiga 500
    Amiga 500+
    Amga...
  7. Replies
    2
    Views
    3,418

    Not sure what you mean by "spoiling performance"?...

    Not sure what you mean by "spoiling performance"? Are you getting overflows or negative values, or is the random generation not 'random' enough?
  8. Replies
    1
    Views
    7,219

    Visual Studio 2017 RC

    Hey Guys!

    I installed Microsoft Visual Studio 2017 RC and it's the first RC version of VS I have ever had - I know a release candidate is not the "final" version of the software, but I am curious...
  9. Thread: code help

    by swgh
    Replies
    4
    Views
    3,755

    1. Main always returns int 2. Your FILE pointer...

    1. Main always returns int
    2. Your FILE pointer should be assigned NULL before it's used if not assigned at declaration
    3. It's also a good idea to assign the struct member "number" something also...
  10. Depends what the tattoo is of. Well, joking...

    Depends what the tattoo is of. Well, joking around it could be a nude woman for example that most people get on board with :D
  11. Replies
    9
    Views
    4,756

    If you feel that could help people look for the...

    If you feel that could help people look for the possible error then yes that could be an idea, but it's your personal work and it's up to you to feel comfortable with what you decide or decide not to...
  12. Thread: For Loop in C

    by swgh
    Replies
    3
    Views
    3,049

    I'll give you some very general tips. Your...

    I'll give you some very general tips.

    Your going to need two loops, one outer loop and one inner loop. Both continuation conditions are going to have to either increment to ten or decrement to...
  13. Replies
    9
    Views
    4,756

    There are generally two reasons for this type of...

    There are generally two reasons for this type of error.

    1. The function has not been defined (generally a prototype) before it's used.

    2. The other and more probable reason is the function name...
  14. Thread: Finding the error

    by swgh
    Replies
    6
    Views
    1,734

    Not that this is entirely related, but it's...

    Not that this is entirely related, but it's always a good idea to check the return value of scanf when it's used.
  15. Replies
    9
    Views
    4,756

    Have you "included" the header file holding the...

    Have you "included" the header file holding the function prototype in the same files as main.c and file.c?
  16. A lot of people on here may have accounts on...

    A lot of people on here may have accounts on other forums too. I know for a fact Salem has/did have an account on Code Project.

    Sorry Salem ;)

    Also - there are a lot of newbie coders joining...
  17. Replies
    9
    Views
    2,346

    Do not ever use goto. Use a loop instead or some...

    Do not ever use goto. Use a loop instead or some other conditional statement to return to that point of the code.
    Do not use getch() it's non-standard and not globally supported on all platforms....
  18. True - colleges and some 'older' books do still...

    True - colleges and some 'older' books do still enforce people learning C++ to learn C style arrays before Vectors. However vectors are part of the STL and perhaps authors of those books or lecturers...
  19. Replies
    5
    Views
    4,915

    Thank you algorism. I really appreciate your...

    Thank you algorism. I really appreciate your input on the subject :).

    Oddly, I generally got the unused warning if for example if I declared but did not use a variable as you stated, just never...
  20. Replies
    5
    Views
    4,915

    Thanks Salem. I swapped the 'c' and 'v' around...

    Thanks Salem.

    I swapped the 'c' and 'v' around and will keep to that format from now on. I still do not understand why I am getting "unused" warnings about the parameters of the main function -...
  21. Replies
    5
    Views
    4,915

    LCC Compiler odd warning

    Hey guys!

    I recently updated code::blocks to the new version for my home laptop and I always compile using the LCC compiler.

    Before the upgrade - this:


    //....
    int main(int argv, char*...
  22. Thread: Programming Tips

    by swgh
    Replies
    27
    Views
    111,888

    Sticky: Ada's Extra Advice: :D Also pick a language...

    Ada's Extra Advice: :D

    Also pick a language that you feel comfortable with. Don't go by the Tiobe Index etc - if your brand new and C/C++ scares you (it shouldn't really as both are good first...
  23. Replies
    4
    Views
    11,320

    The C standard guarantees that any object pointer...

    The C standard guarantees that any object pointer type can be converted to void* and back again without loss of information (meaning that the re-converted pointer will compare equal to the original...
  24. Replies
    5
    Views
    8,594

    >while(!feof(file)) { Does not read the entire...

    >while(!feof(file)) {

    Does not read the entire file correctly. Use


    while (fgets(<string name> sizeof(<string>) fptr) != NULL)
  25. Replies
    6
    Views
    3,474

    Poll: Looks pretty good. Clean and concise code with...

    Looks pretty good. Clean and concise code with good indentation and current standard function calls. One very slight thing, the way you declare your functions seem a little strange:


    void...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4