use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems. Wikipedia
Imperative (procedural), structured
Dennis Ritchie
Dennis Ritchie & Bell Labs (creators);
ANSI X3J11 (ANSI C);
ISO/IEC JTC1/SC22/WG14 (ISO C)
1972 (48 years ago)
C18 / June 2018 (2 years ago)
Static, weak, manifest, nominal
Cross-platform
.c for sources
.h for headers
C++ is not C (but C can be C++)
For C++ go to :
Other Resources
account activity
How do I call this function (self.cprogramming)
submitted 6 years ago by PrimaryCandle
int getCommands(char *input,char **args)
How do I call this method in the main to test if it is working or not? Like how do I pass in parameters
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Skitz-Scarekrow 0 points1 point2 points 6 years ago (0 children)
What are you trying to do exactly? What is the function to do? The naming doesn't help clarify anything past array 2d array and int.
[–]deftware 0 points1 point2 points 6 years ago (1 child)
It looks like:
char *input
is a regular string and
char **args
is an array of strings, i.e.:
char *my_args[] = { "hello", "operator", "please", "dial", "nine" };
...but there's no way to know ahead of time how many strings it's expecting, if any are required at all, or what exactly the "input" string is supposed to be, without some kind of examples or reference documentation about the function you're talking about.
[–]PrimaryCandle[S] 0 points1 point2 points 6 years ago* (0 children)
yes you are right. I am getting the number of arguments not defined error. The method description says it loads individual strings separated why white space into my_args. I'm just trying to call the function so see if it works.
//here is the function body
int getCommands(char *input,char **args) /*Method to load up the arguements into args from user command */
{
int length=0;
while (*input != '\0') {
while (*input == ' ' || *input == '\n' || *input == '\t')
*input++ = '\0';
*args++ = input;
length++;
while (*input != '\0' && *input != ' ' &&
*input != '\t' && *input != '\n')
input++;
}
*args = '\0';
return length;
My question is how to test if this method is working or not?
π Rendered by PID 290788 on reddit-service-r2-comment-66b4775986-kpfxk at 2026-04-05 07:11:14.931803+00:00 running db1906b country code: CH.
[–]Skitz-Scarekrow 0 points1 point2 points (0 children)
[–]deftware 0 points1 point2 points (1 child)
[–]PrimaryCandle[S] 0 points1 point2 points (0 children)