Search:

Type: Posts; User: blob84

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Should it keep getting 2 lines then echoing them...

    Should it keep getting 2 lines then echoing them back until i signal EOF?
    This is the aim of the program.
  2. Thank you for your reply and suggestions about...

    Thank you for your reply and suggestions about the fnget function.
    The reti_writen function can be replaced with the write function.
    basic.h have the headers used for linux network programming.
    I...
  3. socket programming, simple echo server and client

    Hello i have a problem with this program, the client should send a string of two lines from standard input to the server and the server should receive the string of two lines and send back to the...
  4. Replies
    18
    Views
    2,351

    lol! OK Salem thanks.

    lol!
    OK Salem thanks.
  5. Replies
    18
    Views
    2,351

    Ok I need to verify only if there are 2 digits,...

    Ok I need to verify only if there are 2 digits, it doesn't matter what is the next character for this function, is it right?


    int expectedDigit(char **s, int n)
    {
    int cd = 0;
    int i = n;
    ...
  6. Replies
    18
    Views
    9,657

    This is fgets: /* fgets: get at most n chars...

    This is fgets:

    /* fgets: get at most n chars from iop */
    char *fgets(char *s, int n, FILE *iop)
    {
    register int c;
    register char *cs;
    cs = s;
    while (--n >...
  7. Replies
    18
    Views
    2,351

    1. 0 2. to the character after 6 do you think...

    1. 0
    2. to the character after 6
    do you think it is a waste of time scan all digits, so look at this code it should be better:


    int expectedDigit(char **s, int n)
    {
    int cd = 0;

    if...
  8. Replies
    18
    Views
    2,351

    Than it will return false.

    Than it will return false.
  9. Replies
    18
    Views
    2,351

    Yes salem here the code: int...

    Yes salem here the code:

    int expectedDigit(char **s, int n)
    {
    int cd = 0;

    if (isdigit(**s)) {
    cd++;
    while (isdigit(*++*s))
    cd++;
  10. Replies
    18
    Views
    2,351

    Nice suggestion, but the first parameter of the...

    Nice suggestion, but the first parameter of the expected*** function should be the address of the position of the next characters, for example we know that the first 2 characters are numbers so ...
  11. Replies
    18
    Views
    2,351

    Are you talking to validate date, for example day...

    Are you talking to validate date, for example day could not be 56 ?
  12. Replies
    18
    Views
    2,351

    verify date format

    Hello, If i want to verify the format of date dd/mm/year, I can easily use
    sscanf, but i want to do it using a loop what to you suggest?
    For example i can scan it using this code that skip space...
  13. Replies
    4
    Views
    1,181

    I'm wasting time with this book, it's very ugly,...

    I'm wasting time with this book, it's very ugly, the code is ugly and the way it write it and there are a lot of errors.
  14. Replies
    4
    Views
    1,181

    implementing a FIFO queu

    Hello, i found this code on the sedgewick book:

    #include <stdlib.h>
    #include "Item.h"
    static Item *q;
    static int N, head, tail;
    void QUEUEinit(int maxN)
    { q = malloc((maxN+1)*sizeof(Item));...
  15. Replies
    3
    Views
    1,177

    what are you saying is that the parent process...

    what are you saying is that the parent process doesn't exit?
  16. Replies
    3
    Views
    1,177

    linux process question

    Hi, I don't know why when i run this code with redirection of output,
    a.out > file, it seems that the process child is not adopted by init.


    #include <stdio.h>
    #include <unistd.h>
    #include...
  17. Thread: count processes

    by blob84
    Replies
    4
    Views
    2,738

    ok it should be 2^10 processes, 1024

    ok it should be 2^10 processes, 1024
  18. Thread: count processes

    by blob84
    Replies
    4
    Views
    2,738

    count processes

    hi, it is only an exercise,
    how many processes are there in 30 seconds?
    I think 30x9 processes?
    It is impossible to count trying the code.


    #include <fcntl.h>
    #include <stdio.h>
    #include...
  19. Replies
    5
    Views
    3,074

    a full screen text editor without gui, it means...

    a full screen text editor without gui, it means it should work without desktop environment.
  20. Replies
    5
    Views
    3,074

    build a simple text editor

    Hi, i have in mind to build a simpletext editor, not like vi for linux, but more like gedit, but command line not gui.
    For who knows the subjetc, what are the main problems to solve?
  21. Replies
    7
    Views
    18,821

    It is an exercise that ask why this piece of code...

    It is an exercise that ask why this piece of code get this output.
    I don't want to learn to write code like this.
    So the asnwer is only that printf print to stdout and stdout is buffered.
    Stop.
  22. Replies
    7
    Views
    18,821

    Yes anduril462, this is only a test, i will never...

    Yes anduril462, this is only a test, i will never use this code!
    I tried new example like this code:

    #include<stdio.h>
    #include <fcntl.h>
    #include <unistd.h>

    int main() {
    int c, fd;
    fd =...
  23. Replies
    1
    Views
    982

    you should study discrete math.

    you should study discrete math.
  24. Replies
    7
    Views
    18,821

    printf and system call write

    #include<stdio.h>
    #include <fcntl.h>
    #include <unistd.h>
    int main()
    { int fd;
    fd = open("file", O_WRONLY);
    close(1);
    if (dup(fd) >= 0)
    {
    printf(" hello\n");
  25. Thread: fflush function

    by blob84
    Replies
    9
    Views
    5,319

    So fflush should be used after output stream; if...

    So fflush should be used after output stream;
    if occures an error while writing output, calling fflush ensure that the data is printed to the output stream.
Results 1 to 25 of 46
Page 1 of 2 1 2