argv Questions

1

Solved

I have a working program but now I have to use the int argc and char *argv[] parameters to main. Whenever I try to do this it gives me errors that it cannot save. Is there any way to make argc and ...
Decentralization asked 14/2, 2012 at 17:1

4

Solved

In any C program, the command line argument argv[0] points to the name used to invoke the program. Is there any circumstance in which it will point to an empty string ""? An example code snippet ...
Klaxon asked 29/12, 2011 at 8:19

3

Solved

I'd like to write command line scripts in Mathematica, but I can't seem to find an Argv[i_Integer] like function. (The docs are FANTASTIC otherwise.)
Mammon asked 1/11, 2011 at 20:44

1

Solved

I'd like to provide feedback for my pinger program via the command line and view it using ps ax. I found a SO q. But .... ARGV[0] = "Hello!" # does nothing I'm starting the script via ruby ./pi...
Screens asked 19/9, 2011 at 21:52

4

Solved

I have a script that does various things and access parameters using sys.argv but when the script gets to the unittest part of the code it says there is no module for this. The script that I have i...
Sammy asked 11/5, 2010 at 15:57

2

I need to save all arguments to a vector or something like this. I'm not a programmer, so I don't know how to do it, but here's what I've got so far. I just want to call a function system to pass a...
Randellrandene asked 15/6, 2011 at 17:15

1

Solved

code: #test_argv.rb puts "length: #{ARGV.length} " ARGV.each do |a| puts "Argument: #{a}" end If I supply the string "*.*" (with or without quotes) when I call the above, I get the followin...
Bohrer asked 7/6, 2011 at 16:52

1

Solved

I have a Perl script which takes both command line arguments and STDIN #!/usr/bin/perl -w use strict; use warnings; my $logpath = $ARGV[0]; print "logpath : $logpath\n"; print "Name : "; my $nam...
Unsegregated asked 25/3, 2011 at 10:8

4

Solved

I am doing a program where I'm multiplying matricies, but my big issue is converting from the input into the two arrays that I'll eventually be multiplying. The following is my code for conversion ...
Wenonawenonah asked 9/3, 2011 at 5:54

3

Solved

Quoting from docs.python.org: "sys.argv The list of command line arguments passed to a Python script. argv[0] is the script name (it is operating system dependent whether this is a full pathname o...
Mathes asked 7/3, 2011 at 16:44

2

Solved

I want to get other process' argv like ps. I'm using Mac OS X 10.4.11 running on Intel or PowerPC. First, I read code of ps and man kvm, then I wrote some C code. #include <kvm.h> #include...
Gazo asked 16/10, 2008 at 21:34

10

Solved

In C/C++, the main function receives parameters which are of type char*. int main(int argc, char* argv[]){ return 0; } argv is an array of char*, and points to strings. Where are these string loc...
Manche asked 16/11, 2010 at 16:6

3

Solved

I happen to have several functions which access different arguments of the program through the argv[] array. Right now, those functions are nested inside the main() function because of a language e...
Miler asked 30/10, 2010 at 8:53

3

Solved

In perldoc perlvar, I read this: Note that currently "ARGV" only has its magical effect within the "<>" operator; elsewhere it is just a plain filehandle corresponding to the last file op...
Pic asked 29/10, 2010 at 2:46

8

Solved

Possible Duplicates: What are the arguments to main() for? What does int argc, char *argv[] mean? Every program is starting with the main(int argc, char *argv[]) definition. I don'...
Seaddon asked 9/10, 2010 at 21:54

2

Solved

My professor and a couple of students are arguing about whether argv is null terminated or not. My friend wrote a small program and it printed out null but another kid said that he is probably simp...
Jaques asked 22/9, 2010 at 19:15

1

Solved

When you type "ps aux" the ps command shows command arguments that the program was run with. Some programs change this as a way of indicating status. I've tried changing argv[] fields and it doesn'...
Kermanshah asked 21/9, 2010 at 13:41

5

Solved

I have a C# command-line application that I need to run in windows and under mono in unix. At some point I want to launch a subprocess given a set of arbitrary paramaters passed in via the command ...
Sturges asked 2/6, 2010 at 17:42

2

Solved

I'm trying to identify when a particular process is running, based on its arguments, on Mac OS X. There may be several processes running with the same name, but only one will have the arguments I'm...
Corder asked 2/4, 2010 at 20:13

4

Solved

In the data structures class that I am currently taking, we have been tasked with writing a web crawler in C++. To give us a head start, the professor provided us with a program to get the so...
Flicker asked 25/2, 2010 at 17:16

6

Solved

For an assignment, I am required to have command line arguments for my C program. I've used argc/argv before (in C++) without trouble, but I'm unsure if C style strings are affecting how this works...
Cavil asked 20/2, 2010 at 2:7

2

Solved

How would I go about making an array of file pointers in C? I would like to create an array of file pointers to the arguments of main... like a1.txt, a2.txt, etc... So I would run ./prog arg1.txt a...
Chickenlivered asked 11/2, 2010 at 7:34

5

Solved

I have the following snippet of code: int main(int argc, char *argv[]) { char line[MAXLINE]; long lineno = 0; int c, except = 0, number = 0, found = 0; while(--argc > 0 && (*++ar...
Evvoia asked 7/1, 2010 at 14:26

2

Solved

I want to learn more C++... Usually I make a for loop to parse argv, and I wind up with a bunch a C-style strings. I want to do something similar in C++, but preferably without reading from /proc/w...
Caresse asked 29/11, 2009 at 5:39

4

Solved

I would like to prepare an old-school argument vector (argv) to use within the function int execve(const char *filename, char *const argv[],char *const envp[]); I tried it with the stl::vect...
Adaiha asked 5/11, 2009 at 20:12

© 2022 - 2024 — McMap. All rights reserved.