Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.21 seconds.

  1. Replies
    2
    Views
    63

    Your sort function is missing an fclose I...

    Your sort function is missing an fclose

    I wonder if any of the other code you've not posted has missing fclose calls as well.

    Especially one which might have left the file open for writing,...
  2. Just maintain a parallel array of letters you've...

    Just maintain a parallel array of letters you've guessed correctly.


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

    void display(char *word, int *valid) {
    for ( int i = 0 ;...
  3. Replies
    2
    Views
    74

    Also here -> My Assignment For C Project - C And...

    Also here -> My Assignment For C Project - C And C++ | Dream.In.Code
  4. > because if you use them running a C console...

    > because if you use them running a C console application they cause bugs
    So fix the bugs, rather than trying to cover up the evidence and making life hard for your users.

    If they want to press...
  5. Thread: GTK noob

    by Salem
    Replies
    1
    Views
    112

    Why not like this? GtkRecentManager...

    Why not like this?


    GtkRecentManager *recent_files;
    ///
    recent_files = gtk_recent_manager_new();
    gtk_recent_manager_set_limit(recent_files,9);


    > GList gl[21];
  6. Replies
    1
    Views
    131

    First of all, you need better indentation....

    First of all, you need better indentation.
    Indentation style - Wikipedia

    Also, you're calling SDL_PollEvent in TWO places, where you should only be calling it in one.
  7. Replies
    6
    Views
    138

    > *output = atoi(input); What is input contains...

    > *output = atoi(input);
    What is input contains "-1" ?
    How will you tell that from your error return?

    I tend to follow the model that the function return value is the success/fail status, and...
  8. Replies
    3
    Views
    135

    The electrons whizzing through the transistor...

    The electrons whizzing through the transistor gates know nothing about data structures.
    The transistors themselves know nothing either.
    The collective billions of them you inaccurately call 'PC'...
  9. Replies
    12
    Views
    158

    I guess the fun exercise is to try writing your...

    I guess the fun exercise is to try writing your own version of vector.
  10. Replies
    2
    Views
    128

    You could send a pm to webmaster...

    You could send a pm to webmaster.
  11. Replies
    6
    Views
    138

    > char* labels [NUMMENUS]; > bool...

    > char* labels [NUMMENUS];
    > bool selected[NUMMENUS];
    Array sizes are compile time constants in C++.
    You're trying to make it variable.

    Perhaps you should be looking at say std::vector,...
  12. Thread: Hangman game

    by Salem
    Replies
    5
    Views
    171

    > thanks for the advice. I changed scanf("%s,...

    > thanks for the advice. I changed scanf("%s, name) for gets(name) and now its working.
    No no no no no!!!!
    NEVER EVER USE gets()
    Seriously!
    c - Why is the gets function so dangerous that it...
  13. Replies
    5
    Views
    155

    I rather suspect OP has been getting overly...

    I rather suspect OP has been getting overly generous marks from their tutor up until this point.

    This code needs an 'F', regardless of whether it finally produces the right answer or not. The...
  14. Replies
    1
    Views
    118

    Well, char str[5];...

    Well,


    char str[5];
    sprintf(str,"%d",compute);


    Saying strlen(str) > 2 is just the long way of saying compute >= 100.
  15. Replies
    1
    Views
    253

    You can create a program that opens a port and...

    You can create a program that opens a port and listens for connections that your browser can make - yes.

    Or are you thinking about this?
    Selenium Projects
  16. Replies
    5
    Views
    155

    So, while you're copy/pasting your way to 600+...

    So, while you're copy/pasting your way to 600+ lines, I made a sampler.


    #include <iostream>
    #include <iomanip>
    using namespace std;

    class Board {
    private:
    char board[3][3][3];
  17. Replies
    1
    Views
    95

    First, fix these. foo.cpp: In function ‘int...

    First, fix these.


    foo.cpp: In function ‘int LauraAI()’:
    foo.cpp:20:66: error: ‘printf’ was not declared in this scope
    printf ("\nLaura-AI chose board %d to play in\n", BoardChoice);
    ...
  18. Replies
    6
    Views
    126

    Nothing you have in main at the moment can...

    Nothing you have in main at the moment can correctly call checkSizesLast() with any amount of casting or dereferencing.

    checkSizesLast is expecting an array (of some dimensions) who's most basic...
  19. Replies
    1
    Views
    124

    > i tried to redirect STDOUT to the socket but I...

    > i tried to redirect STDOUT to the socket but I didn't get what I need
    Post your example of what didn't work.
  20. Replies
    13
    Views
    207

    > Your instructor is wrong. However, you probably...

    > Your instructor is wrong. However, you probably should do things the way he wants anyway.
    Or send the instructor here for better education, or just forward them the message threads.
  21. Replies
    13
    Views
    207

    A stack is a LIFO (Last In, First Out) data...

    A stack is a LIFO (Last In, First Out) data structure.
    That is, you 'push' and 'pop' from just one end.

    A queue on the other hand is a FIFO (First In, First Out) data structure.
    You 'push' on...
  22. Replies
    5
    Views
    114

    Why are you basing your rng() on time() and...

    Why are you basing your rng() on time() and clock().

    Which, depending on how often you call them, return
    - the same as last time
    - +1 from last time
    - always some number greater than last time....
  23. Replies
    8
    Views
    139

    You need to show us your StrStackPush() and how...

    You need to show us your StrStackPush() and how you call it.

    Because if you don't know where your strings are, chances are - you're doing it wrong.
  24. Replies
    6
    Views
    160

    #include int main(void) { // start...

    #include <stdio.h>
    int main(void)
    { // start scope1
    int i = 2; // i begins at this ;
    for (int j = 0;/* j begins at this ;*/ j < 5; ++j)
    { //start scope2
    // j can be only...
  25. Replies
    17
    Views
    364

    > If I have a list of 1 ,2, 3, 8, 9, 9, 21, 31,...

    > If I have a list of 1 ,2, 3, 8, 9, 9, 21, 31, 45, 71 and 124, I would get a price 868, but the correct answer is 849. It must be a different principle.
    Maybe you're allowed to rearrange the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4