New answers tagged

0

After reading the following email from Linus Torvalds the creator of linux. I can't help thinking the answer above is incorrect. He seems to think that C++ programmers are not good systems programmers. And that the extra features in C++ often cause more problems in the long term compared to the benefits they bring in the short term. While one may disagree ...


1

sed -i '\_//_{s_//_/* _g;s_$_ */_g}' file.c indent -fc1 -fca -sc -cdb file.c sed -i 's/\/\*\(.*\)\*\/$/\/\/\1/' file.c does what you requested, but I would be cautious as it probably misses some edge cases Input: // Lorem ipsum dolor sit amet, apeirian constituam interpretaris no his, soluta salutandi persequeris vel ne, facete impedit contentiones te ...


0

You can parse it directly using the bash shell's built-in read function, by setting the field separator to = while IFS== read -r name value; do arr1+=("$name") arr2+=("$value") done < model.conf The arrays will be zero indexed by default, i.e. $ echo "${arr1[0]}" customer $ echo "${arr2[0]}" "airtel" Since variables (including arrays) have ...


0

With awk: eval $(awk -F= -v i=0 '{print "arr1["i"]="$1";arr2["i"]="$2;i++}' model.conf) With = as field seperator and variable i with initial value 0, awk will print "arr1["i"]="$1";arr2["i"]="$2 for each line where $1 will have the key and $1 will have the value and increment i for each line. awk -F= -v i=0 '{print "arr1["i"]="$1";arr2["i"]="$2;i++}' ...


2

I got this to work, for some reason it requires both -fc1 and -fca options: indent -fc1 -fca j.c Alternatively, you can use the Berkeley style: indent -orig j.c Input: // Lorem ipsum dolor sit amet, apeirian constituam interpretaris no his, soluta salutandi persequeris vel ne, facete impedit contentiones te eam. Ut utamur habemus qualisque usu #...


2

There's no general way to know which library is required to use a particular function. You need to look at the documentation of that library. A well-written tutorial or API reference should tell you, that's its job. You can at least get an idea of what library package is required: it's the same library package that contains the header file. How to determine ...


2

The error messages are near the end; the beginning is not shown. The ldd does not show the pathnames used for linking new programs. It only shows pathnames used for running existing programs. You might be missing the development package for OpenSSL, which would include symbolic links for names ending with ".so" (which would point to the versioned library ...


1

As can be seen in the Catalogue of Built-In Rules: Linking a single object file n is made automatically from n.o by running the linker (usually called ld) via the C compiler. The precise recipe used is: $(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS) and Variables Used by Implicit Rules: LDFLAGS Extra flags to give to compilers when they ...



Top 50 recent answers are included