Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. brudnakm

    Segmentation Fault

    ...font of the list. It is clean and easy and if order does not matter it is the preferred method. static head = NULL ; void addToFront( struct node *new ){ new->next = head ; head = new ; } Otherwise you could add to the end of the list as follows: static head = NULL ; static end ...
  2. brudnakm

    character string memory allocation

    Dennis, You are right. s is an arrary of const chars, my mistake. Since arrays and pointer are so similar in C I sometimes use them synonomously. Now to your question. In your second example s is an array so s = foo ; is illegal. In your third example s is a pointer so [code]s = foo ...
  3. brudnakm

    character string memory allocation

    Dennis, There are four places that variables are stored. 1) The data segment (globals, static, const) 2) The stack (local variables) 3) The heap (malloc) 4) Processor registers (compiler-chosen local variables) I believe that a literal string will always be in the data segment, i.e. the actual...
  4. brudnakm

    CGI Timeout

    When you receive a new connection, spawn a thread which will handle the file send. Your main thread can then continue to listen for new connections.
  5. brudnakm

    Could anyone give some url ....

    Try, http://www.cs.cf.ac.uk/Dave/C/node27.html#SECTION002700000000000000000 Mark.
  6. brudnakm

    unix c shell question, fgrep and printf question

    Try, echo $variable1:$variable2:$variable3::: >> filename
  7. brudnakm

    C functions helper

    use xman to look at all of the functions available in section 3. Mark.
  8. brudnakm

    void pointer

    ...which is called a pointer in C. This is why all pointer are of the same size. So if our variable is a float, declaring a pointer of float * tells the compiler to interpret the data at that address as a float (whether it is or not). Likewise for the other types. A void pointer is a pure...
  9. brudnakm

    DNS Responses seem slow

    Do you have more than one name server in your /etc/resolv.conf. If you do, they are searched in the order in which they are in the file. If your first listed nameserver is offline, then you will have to wait for a time out before the next one is tried. Mark.
  10. brudnakm

    source code editor

    keenanbr, Without question, vi is the best text editor ever invented!! There are several ports of vi to Windows. I highly recommend vim (VI Improved). You can get it at: http://vim.sourceforge.net/ It supports all of the familiar vi and ex commands you are used to and more. It also gives...
  11. brudnakm

    Will the child process by fork() automatically copy the shared memory

    Blueruby, Just a couple of points of clarification. 1) Shared memory will be available to forked child processes. If you are sharing with only child processes, create and attach before the fork and everything will be automatic. In this case you can use the IPC_PRIVATE key to create the...
  12. brudnakm

    MEMSET: how do I use it?

    ...specify various actions to take, depending on which of them are non-zero. In linux the structure look like this. struct sigaction { void (*sa_handler)(int); void (*sa_sigaction)(int, siginfo_t *, void *); sigset_t sa_mask; int sa_flags; void (*sa_restorer)(void); } We use bzero()...
  13. brudnakm

    Stack Setup in Operating Systems

    Any modern computer OS will have separate stacks (and address spaces) for each process. The kernel should execute in its own address space and run in processor supervisor/privileged mode. Additionally you should implement your design using virtual memory, allowing any process's stack (or heap)...
  14. brudnakm

    MEMSET: how do I use it?

    Fabien, memset() writes memory that has been allocated. It is sometimes used to initialize memory for a variety of purposes. It is sometimes used to clear a structure which is passed by reference for the purposes of returning data to the caller (for example, see shmctl(), semctl(), etc)...
  15. brudnakm

    How to do load data in "Shared Memory"?

    fabien, Use shmget() to create a shared memory segment. Use shmat() to get a pointer to the shared memory segment. The details are in the man pages. Mark
  16. brudnakm

    C - programming materials for beginner needed

    Are you a programmer in another language? There is a big difference between learning another language and learning yor first language, because most of learning your first language is learning how to program (i.e. variables, procedures, looping, compiling, etc.).
  17. brudnakm

    pb queues of messages

    Hello, The problem is that infosQueue does not point to real memory. try: struct msqid_ds infosQueue; /* Note the missing '*' */ msgctl(IdQueue,IPC_STAT, &infosQueue); /* Note the inserted '&' */ Brudnakm
  18. brudnakm

    Pls Help C Problem

    Your if statement is way too complicated. Please simplify and your answer will probably be obvious. If not, please simplify and repost. Brudnakm.
  19. brudnakm

    definitions of instructions

    nop stands for no-op. This causes the CPU to idle for one clock cycle. cop will give you a ticket if you go too fast. :-) Seriously, I am not familiar with the cop instruction. Brudnakm
  20. brudnakm

    c .exe of a differential Equation 'HARD ONE'

    I recommend that you use a runge-kutta 4th order. It is very standard and can be found in a numerical methods book. It can be implemented in less than ten lines of code. Brudnakm

Part and Inventory Search

Back
Top