Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.24 seconds; generated 16 minute(s) ago.

  1. Thread: C complier

    by Salem
    Replies
    4
    Views
    611

    I find it easier to just download...

    I find it easier to just download codeblocks-20.03mingw-setup.exe from Binary releases - Code::Blocks
    You get the MinGW compiler and an IDE all from a single install, and it just works without any...
  2. Thread: C complier

    by Salem
    Replies
    4
    Views
    611

    Which OS? All the good ones are free. ...

    Which OS?

    All the good ones are free.

    Linux, you have
    GCC, the GNU Compiler Collection - GNU Project
    Clang C Language Family Frontend for LLVM

    Windows you have
    Visual Studio: IDE and Code...
  3. Replies
    2
    Views
    150

    Rather than printing characters, make a table. ...

    Rather than printing characters, make a table.


    #include <stdio.h>

    int f(int n)
    {
    int r = 0;
    for (int i=1; i<=n; i++)
    {
  4. Replies
    4
    Views
    882

    > but for multi-user system is not that good ...

    > but for multi-user system is not that good
    Sorry, this just seems like an attempt to steal everyone else's credentials.

    > After i type in the passphrase i want to save the passphrase in a file...
  5. Replies
    4
    Views
    882

    Why don't you pass the passphrase on the command...

    Why don't you pass the passphrase on the command line to begin with, if you want the passphrase in a file.
  6. Replies
    1
    Views
    1,721

    The first thing might be to fix all the...

    The first thing might be to fix all the compilation errors.
    It might look like C, but you need a C++ compiler to compile it.


    $ gcc -g bar.c
    bar.c: In function ‘successor’:
    bar.c:235:5: error:...
  7. > what if you want to write a compiler which is...

    > what if you want to write a compiler which is what I want to do?
    Have you actually read any books or courses on compiler construction?

    Just making it generate correct code will be achievement...
  8. First off, trying to time anything calling printf...

    First off, trying to time anything calling printf is a fools errand.
    You're trying to measure an ant-fart in a hurricane.

    Second, it's basically the same code whichever way you write it.
    ...
  9. Replies
    3
    Views
    330

    Well if you don't mess up the numbering with an...

    Well if you don't mess up the numbering with an assignment, you typically do this.


    typedef enum {EMPTY, RST, PWM_DIV, PWM_DUTYCYCLE, DAC_REF, ADC_SAMP_TIME, ADC_NUM_SAMPLES, ADC_CONV, CMD_LAST}...
  10. Replies
    9
    Views
    660

    > char sorted_key[strlen(key)]; This should be...

    > char sorted_key[strlen(key)];
    This should be
    char sorted_key[strlen(key)+1];

    You need the +1 for the \0 at the end of the string.
  11. Compile with the -c flag, then use the nm tool to...

    Compile with the -c flag, then use the nm tool to find out what the external names actually look like.


    $ g++ -c foo.cpp
    $ nm -u foo.o
    U __cxa_atexit
    U...
  12. Consider some refactoring of the code. ...

    Consider some refactoring of the code.



    #define B_MAX_ROWS 10
    #define B_MAX_COLS 10
    #define F_MAX_ROWS 10
    #define F_MAX_COLS 10

    double blade_d[B_MAX_ROWS][B_MAX_COLS];
  13. Replies
    1
    Views
    9,621

    > What does Linux programming mean to you? It...

    > What does Linux programming mean to you?
    It means your platform is Linux rather than Windows (or some other OS, or even no OS).

    Basically, it means referring to
    Linux manual pages: section 2...
  14. Replies
    2
    Views
    2,528

    My order, just based on a bit of reading. 3....

    My order, just based on a bit of reading.

    3. overloaded-virtual clang
    c++ overloaded virtual function warning by clang? - Stack Overflow
    It depends what the programmer was trying to achieve....
  15. Replies
    5
    Views
    2,921

    > in this code you hard coded the columns and...

    > in this code you hard coded the columns and rows when swapping.
    That's only to show you how it works.

    > How can I code it so that it does the calculations to this?
    Well where in the code do...
  16. Replies
    5
    Views
    2,921

    Study this -> A development process...

    Study this -> A development process

    Then this.


    #include <stdio.h>
    #include <string.h>

    // Use a fixed sized array to test with before
    // adding complications with variable sizes
  17. Write of size 4 at 0x7ffc9cf005cc by thread T3...

    Write of size 4 at 0x7ffc9cf005cc by thread T3 (mutexes: write M7):
    #0 calculate_map /mnt/nfs/homes/rpohlen/Documents/......../fractol_draw.c:93:18 (fractol+0x4b8ef6)


    Previous read of...
  18. > data->map is malloced but not zero filled. It's...

    > data->map is malloced but not zero filled. It's used over and over by threads and freed at the end of the program.
    I noticed your test code allocated


    data.map = malloc(WINX *...
  19. > This is a school assignment and for some reason...

    > This is a school assignment and for some reason at my school, for loops are forbidden.
    A lot of tutors seem to have a perverse delight in making students 'do x' without using the most rational...
  20. Replies
    5
    Views
    735

    Garbage at the start of the string is a sign that...

    Garbage at the start of the string is a sign that you're not initialising your dynamically allocated string properly.

    See my example.
  21. Replies
    1
    Views
    327

    Well if you have all the characters in a buffer,...

    Well if you have all the characters in a buffer, like

    char buff[] = "24A3\r";

    Then strtol, strtoll - cppreference.com
    long x = strtol(&buff[1], NULL, 16);
  22. Replies
    5
    Views
    735

    It would be helpful to see an example of a before...

    It would be helpful to see an example of a before and after.

    > char *censor(char *message, char *list)
    What is the output of
    censor("the cat sat on the mat","at cat mat");

    message and list...
  23. Well read_string isn't actually storing anything...

    Well read_string isn't actually storing anything in sentence.


    char read_string(char *fname, char *sentence){
    printf("Enter the filename:");
    scanf("%s",fname);

    FILE* ptr =...
  24. Replies
    2
    Views
    15,600

    Well saying _TEXT and L together is redundant....

    Well saying _TEXT and L together is redundant.
    The _TEXT macro automatically puts an L in the result when in UNICODE mode.

    Eg
    _TEXT("HelloMsg")

    I also had to save the source file as a UNICODE...
  25. Recall that a string constant has a type of...

    Recall that a string constant has a type of 'const char *'

    And all string constants will compare as not equal to NULL.
    A pointer in a boolean context is implied as comparing it with NULL.
    So in...
Results 1 to 25 of 491
Page 1 of 20 1 2 3 4