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 strongm 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

    I would recommend the following code. It works whether the list is empty or not. The only drawback is that it appends new items to the 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 ){...
  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

    Denniscpp, A pointer is an address which references memory (usually virtual memory). Bytes in memory are organized in a linear fashion by their addresses starting with byte 0 (address 0) and ending with byte N (N is very large). So an address is an unsigned integer. If the address is '4'...
  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?

    Fabien, Probably the best example that I can think of is sigaction in UNIX. A sigaction is a structure which refernces actions to tasks when a signal is raised. The fields of this structure specify various actions to take, depending on which of them are non-zero. In linux the structure look...
  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