Tagged Questions
0
votes
0answers
42 views
Reading a string from dynamic outputs in C [closed]
I need to know how to read a string from a dynamic output console in C programming.
My output is similar to following strings..
"additional",
"connected",
"OK",
"try again",
"success",
"failed",
...
0
votes
3answers
81 views
How to manage intermediate outputs efficiently?
I am implementing a C preprocessor in C...
I have the three functions:
trigraph replacing function
Line splicing function
comment removing function
However these functions work separately on ...
3
votes
4answers
2k views
Initializing char array with string
I don't remember how I got to the thread, but I was reading its replies and one of them states that you should never initialize a char[] with a string literal.
My question: Is initializing a ...
-2
votes
1answer
128 views
C Minishell Command Expansion Printing Gibberish
I'm writing a unix minishell in C, and am at the point where I'm adding command expansion. What I mean by this is that I can nest commands in other commands, for example:
$> echo hello $(echo ...
6
votes
4answers
422 views
Should functions of a C library always expect a string's length?
I'm currently working on a library written in C. Many functions of this library expect a string as char* or const char* in their arguments. I started out with those functions always expecting the ...
2
votes
3answers
695 views
Why do people put '\n' at the beginning of strings?
Very often I get into C code where printf format strings start with \n:
printf( "\nHello" );
This in my opinion is an annoying thing that offers no advantages (rather many disadvantages!) with ...