Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. For starters, global variables are usually...

    For starters, global variables are usually considered a bad practice, learn to pass those variables to and from the functions that need them.

    Initialize your variables when you declare them. And...
  2. Unless you're talking about a static or global...

    Unless you're talking about a static or global variable, not all compilers will initialize your variables in debug mode. Static and global variables are always default initialized.
  3. Or stick the code in a function.

    Or stick the code in a function.
  4. Replies
    2
    Views
    455

    The order matters. If the stream enters a fail...

    The order matters. If the stream enters a fail state no further processing of that stream can occur until the errors are cleared. This means that the clear() must be the first thing done.
  5. Replies
    3
    Views
    314

    What compiler/IDE are you using? It looks like...

    What compiler/IDE are you using?

    It looks like your compiler can't find the header file lib_string.h. Does the file exist? If it does exist where exactly is it located? Is it in the same directory...
  6. Replies
    4
    Views
    387

    Also please note that "stdlib.h" and "stdio.h"...

    Also please note that "stdlib.h" and "stdio.h" are header files, not libraries. These headers describe functions contained in the standard library.



    I'm not aware of any easy way to make a user...
  7. Did you even bother to read the previous posts? ...

    Did you even bother to read the previous posts?

    Also if you're getting an error you probably need to update your compiler and make sure it is using one of the modern standards.
  8. Also are you sure you have the correct operator? ...

    Also are you sure you have the correct operator?

    And are you sure that your equations are correct (ie ea > es or should it be es < ea)?
  9. Have you run the program with your debugger to...

    Have you run the program with your debugger to look at the values of the variables as you single step through the code?

    Why are you using C99 instead of C11?

    What version of gcc are you using?...
  10. Perhaps you need to assign a value to ea instead...

    Perhaps you need to assign a value to ea instead of trying to use an uninitialized variable?



    #include<stdio.h>
    #include<math.h>
    #include<iso646.h>

    int factorial(int n);
    void...
  11. Replies
    2
    Views
    261

    Do you know that is a C++ header that...

    Do you know that <fstream> is a C++ header that is not available in a C program?
  12. How many times are you trying to read the files?...

    How many times are you trying to read the files? It appears to me that you are trying to read each file more than once, without resetting the file flags and FILE*.

    You really should be checking...
  13. while (fscanf(input,"%lf %s %d %d %d", &ID, n,...

    while (fscanf(input,"%lf %s %d %d %d", &ID, n, &ELA, &Math, &Science) != EOF)
    ^ Possible buffer overflow error waiting to happen.
    ...
  14. Replies
    11
    Views
    711

    That's probably because you are not "syncing"...

    That's probably because you are not "syncing" your read and write operations properly.

    First it is usually a mistake to use EOF to control a data entry loop, remember that EOF is not set until...
  15. Replies
    5
    Views
    506

    You said you wanted open source on Linux, the two...

    You said you wanted open source on Linux, the two biggest players that meet that criteria are clang and gcc. There are probably others, some even listed in the link above that you can download and...
  16. Replies
    5
    Views
    506

    If you're using full blown Linux then clang or...

    If you're using full blown Linux then clang or gcc seem to fit.
  17. Replies
    55
    Views
    3,378

    Did you search your filesystem for that file?

    Did you search your filesystem for that file?
  18. Replies
    55
    Views
    3,378

    This is the C++ forum, and in C++ main() must be...

    This is the C++ forum, and in C++ main() must be defined to return an int. If you use a truly standard compliant compiler void main() is not allowed. And if you don't use a truly standard compiler...
  19. Replies
    55
    Views
    3,378

    True, but with some operating systems it must be...

    True, but with some operating systems it must be a very small positive integral value. And with C++ if no return value is supplied zero will be returned.
  20. Replies
    55
    Views
    3,378

    You'll need to post your code. However it is...

    You'll need to post your code. However it is telling you that your program returned a value other than zero, which usually indicates some kind of failure of your program.
  21. I hope "it argc" is a typo, it should be "int...

    I hope "it argc" is a typo, it should be "int argc".

    How exactly are you calling the program?

    What are your actual command line arguments?
  22. Do you realize that std::string.c_str(), returns...

    Do you realize that std::string.c_str(), returns a const C-string, which means that you can't modify that C-string?
  23. Replies
    5
    Views
    511

    Start by doing some research. Use your favourite...

    Start by doing some research. Use your favourite search engine, searching for something like "c string comparison" should give you a good start,

    By the way I'd judge about a 2 maybe 3.
  24. Thread: Struct.

    by jimblumberg
    Replies
    11
    Views
    502

    You need to show some actual effort, no one here...

    You need to show some actual effort, no one here is going to just give you the solution.


    Break the problem down to manageable chunks, don't try to solve the entire program in one go. I'd start...
  25. Thread: Struct.

    by jimblumberg
    Replies
    11
    Views
    502

    Why not? Explain yourself, your question really...

    Why not? Explain yourself, your question really doesn't make much sense. If you want more coherent answers you need to provide more coherent questions.

    Do you understand the difference between a...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4