I'm trying to create a simplified version of dc to learn from. The first thing I notice is that the main stack stores strings. How would I implement a string stack in C? How is something like this:
Thoughts?
---------- Post updated at 06:33 PM ---------- Previous update was at 04:59 PM ----------
Actually I don't think I need the stackPtr because I can just use the basePtr + the logicalSize.
Come to think of it, I wrote a simple string list which can easily be modified for what you need. Just one function missing...
If it has to enlarge the size of the stack, then the pointer may change, so pay attention to the return value of the functions when they return strlist *'s.
[edit] Oh yeah. And if you pop() a string, you have to free() the pointer it returns.
Last edited by Corona688; 10-05-2012 at 12:26 PM..
Hi,
I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Hello All,
I am trying a shell script for automatically login to test servers and pulling the output of top command from all using expect.
----snippet of code ---
#!/usr/bin/expect -f
#!/bin/bash
server1=10.251.222.51
server=("$server1")
i=1
for exp_server in ${server}; do
expect -c... (3 Replies)
i have following input file...
00290002STDR000000000000000000000000000EOD END TRANSACTION ^@^@^@^@^@^@^@^@^@^@^@^@^
00299998STDR070000000007000000000000000STANDING DEBITS ^@^@^@^@^@^@^@^@^@^@^@^@^... (1 Reply)
I'm trying to add logging to an existing script which echos a number of lines to the screen. I've added a switch to the script that is going to suppress much of this output and put it in a file instead.
The way I envisioned it was like this:
$log would be set to either "" or the log files... (8 Replies)
I am trying to implement a login screen to the following code how would i go about doing so. I have try to place the password in a variable using if statements which would usually work but as i have the system in a while loop i think i need to find another method.
#!/bin/bash
#Filename:... (4 Replies)
Hello,
I am trying to implement TCP protocol in C.
I have read the RFC for TCP and have knowledge about it.
But I am stuck in coding.
Are ther any reference links, code snippets available for reference? (1 Reply)
Hi,
I am implementing a shell in C, with the following problem...
Suppose the shell is invoked from the command line as
>> myshell < test.in > test.out 2>&1
I have to execute the commands in test.in and redirect them to test.out
How does one detect in the main function that the shell... (1 Reply)