Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I have some sort of funny question about addresses in C++. I have such code: This code works, but allocation of addresses fears me. Does
Tag: arrays
passing bash array to python list
I’m trying to pass an array from bash to python using the old getenv method however I keep getting this error: could someone please explain why the $mdcNo isn’t passing from bash to python successfully? Code .sh: code .py: Answer If you want to pass a shell array to the Python script, your best bet is to do so as
Why are the values in my dynamic 2D char array being overwritten?
I’m trying to build a process logger in C on Linux, but having trouble getting it right. I’d like it to have 3 colums: USER, PID, COMMAND. I’m using the output of ps aux and trying to dynamically append it to an array. That is, for every line ps aux outputs, I want to add a row to my array.
Can not assign function parameters to local array variable in `Zsh`
I just try to assign parameters of function as local array variable, I tried I got But if I remove local keyword It’s work What is a problem here? How can I keep my array to local variable? Additional information I tried this on bash shell, it’s work well either as local or global variable. Answer In order to make
How can I read the files from a tar command into an array using BASH?
Using a BASH script, how can I execute a tar command and read the output (the list of files) into an array? I’ve tried a number of things, including: I’ve tried with and without the backquote (grave accent) and I’ve tried using t as an option on the tar.gz file. I was trying to accomplish this without sending the output
Convert char array of C into string of C++
I need to convert char array of C into string c++ but the char array is an element of struct. Code: This is my Structure in C and I want to access name[50] in c++ but for that I have to convert it into string. I have tried strcpy and memcpy. I am using ESL_BOOL status; and it is working
How to read a file line by line
I try to read a file line by line. File to read: Script: When I execute the script, this window will be opened: (Notice how some values are repeated, and the contents don’t correctly alternate between names and versions): I’d like to create an array with all package names and versions. Answer You don’t need a counter for this at
Output results from Linux command into a table with PHP
I’m mid way through clobbering together a captive portal to run on a Raspberry Pi and have the basics working, but I’m now stumbling whilst creating some administration pages. What I am essentially trying to do is create a table in HTML/PHP so that I have the ability to “kick” users from the service. I have a script already in
ruby Array.inspect vs. Array[element].to_s
I’m working with an array, which we’ll call books, of complex objects, which we’ll call Book. The problem is when I call puts “#{books.inspect}”, ruby outputs a stream of binary (unreadable utf8 characters). However, when I call puts #{books[0].to_str}”, I get a brief, pretty output that describes the book in question. Not sure if it is relevant, but Book is