int main(void){ char* line = "CCCCCCC\nC+\nC++"; char* line2 = "a\nb\nc"; //char* pattern = ".\\+\\+"; //int n= strlengp(line); printf("%s\n", line); printf("%s\n", line2); fputs(line, stdout);   This code correctly prints: CCCCCCC  C+  C++  a  b  c  Now my issue is this, I am working on  rgrep function implemented without string.h. Below is the main from the code im working on, which I am not to modify.  int main(int argc, char **argv) {    if (argc != 2) {         fprintf(stderr, "Usage: %s &lt;PATTERN&gt;\n", argv[0]);         return 2;     }      /* we're not going to worry about long lines */     char buf[MAXSIZE];      while (!feof(stdin) &amp;&amp; !ferror(stdin)) {         if (!fgets(buf, sizeof(buf), stdin)) {             break;        }        if (rgrep_matches(buf, argv[1])) {            fputs(buf, stdout);            fflush(stdout);        }    }      if(ferror(stdin)) {        perror(argv[0]);        return 1;    }     return 0; }  int rgrep_matches(char *line, char *pattern){    printf("%s", line);    return 0; }   Now when I run the above code on  test test file containing the same strings as the above code "CCCCCCC\nC+\nC++","a\nb\nc".  Whys does the above code output:  CCCCCCC\nC+\nC++  a\nb\nc  Clearly ignoring the '\n'.  When the test code built in a different file posted at the top of the page prints:  CCCCCCC  C+  C++  a  b  c  What is going on here?
The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.
Long names cut off in questions and answers The Unhandled Exception's name is cut off in this  and in the answer too. The last 'n' looks like an 'r'.  Using Firefox 3.6.6.  Examples: Displaying equations, how to combine strings and values without evaluating everything. How can I wrap text around a bottom-right div? Every time I try to do something seemingly-simple in CSS, it doesn't work.  I have a content div that contains a 460x160 image. All I want to do is position the image at the bottom-right corner and wrap my text around it.  &lt;div id="contents"&gt;     &lt;img src="..." /&gt;     text text text text text text ... &lt;/div&gt;   So I want it to look like:  ------------------ | text text text | | text text text | | text text -----| | text text |    | ------------------   Doing it with a top-left or top-right image is cake:  #contents img { float:right; }  ------------------ | text text |    | | text text -----| | text text text | | text text text | ------------------   Now how do I push that to the bottom? The best I've come up with so far are:  #contents img { float:right; margin-top: 90%} // really needs to be 100%-160px  ------------------ | text text      | | text text      | | text text -----| | text text |    | ------------------   In this case the text does not print in the margin, so there is white space above the image.  #contents { position:relative; } #contents img { position:absolute; right:0; bottom:0; }  -or-  // move the img tag under the text in the html and: #contents img { float:right; margin-top:-160; }  ------------------ | text text text | | text text text | | text text -----| | text text | te | ------------------   In this case the text prints over or under the image.  So... how can I accomplish this? How to increase the Java stack size? Undo a particular commit in Git that's been pushed to remote repos $\lim\limits_{n \to \infty} \frac{a_n}{b_n}=l$ ; Prove $\sum\limits_{k=1}^\infty a_k$ converges iff $\sum\limits_{k=1}^\infty b_k$ converges. Written, in Ex.8 Ch.9.1 of the book Advanced Calculus by P. M. Fitzpatrick :     Suppose that $\sum\limits_{k=1}^\infty a_k$ and $\sum\limits_{k=1}^\infty b_k$ are series of positive numbers such that $$\lim_{n \to \infty} \frac{a_n}{b_n}=l \ \ \ \text{and} \ l&gt;0.$$ Prove that the series $\sum\limits_{k=1}^\infty a_k$ converges iff the series $\sum\limits_{k=1}^\infty b_k$ converges.   Am I correct by the following (sketch of) proof? :  1- For a given $\epsilon_1$ there is $N_1$ such that $\left|\frac{a_n}{b_n} - l\right| &lt; \epsilon_1$ for all $n \ge N_1$.  2- Since the series $\sum\limits_{k=1}^\infty a_k$ converges, for a given $\epsilon_2$ there is $N_2$ such that $\left|b_{n+1}+\dots+b_{n+k}\right|&lt; \epsilon_1$ for all $n \ge N_2$ any for all natural numbers $k$.  3- Define $N = \max {\{N_1,N_2}\}$.   4- From Step (1), $a_{n+k} &lt; (\epsilon_1+l) b_{n+k}$ for all $n \ge N$ any for all natural numbers $k$. [Also, $a_i$'s and $b_i$'s are all positive]. Thus $a_{n+1}+\dots+a_{n+k} &lt; (\epsilon_1+l) (b_{n+1}+\dots+b_{n+k})&lt; \epsilon_3$. Then the convergence of the series $\sum\limits_{k=1}^\infty b_k$ implies the convergence of the series $\sum\limits_{k=1}^\infty a_k$.  5- For the reverse implication, we use the fact that $\lim\limits_{n \to \infty}\frac{a_n}{b_n}=l \iff \lim\limits_{n \to \infty}\frac{b_n}{a_n}= \frac{1}{l}= l' &gt;0$ and repeat the process this time for a and b exchanged.   6- The Quotient Property For Sequences hold for a nonzero limit in the denominator, but since the limit in the numerator also is zero so we may use the The Quotient Property For Sequences.    Thanks. There is an alignment issue in the stackexchange.com search page .  The bottom bar is missing in the search input box.  Sample URL:   Screen shot for reference:    Firefox version: 54.0b8 (32-bit) OS Version: Windows 10 Pro  Also happens with Chrome latest version. Implementing a Custom Subscription Center in Salesforce Marketing Cloud Has anyone implemented a custom subscription center using landing pages? The example one from the documentation doesn't seem to be working. I would really like to just customized the out of the box one but the amp script is hidden when I view source. Does anyone have and tips/tricks for creating a sub center?  Thanks! Bake Simple Deform animation into mesh for Unity3D export? I'm trying to use a .blend file with a keyframe animation on the angle of a Simple Deform modifier in Unity3D. Unity3D however does not know how to handle modifiers and hence cannot play the animation.  How can I bake/save the animation to the .blend file so that Unity3D can play it? Having migrated to Linux from Windows, I would like to find an alternative software to Winmerge or rather learn command line tools to compare and sync two folders on Linux. I would be grateful if you could tell me how to do the following tasks on the command line... (I have studied diff and rsync, but I still need some help.)  We have two folders: "/home/user/A" and "/home/user/B"  Folder A is the place where regular files and folders are saved and folder B is a backup folder that serves as a complete mirror of folder A. (Nothing is directly saved or modified by the user in folder B.)  My questions are:   How to list files that exist only in folder B? (E.g. the ones deleted from folder A since the last synchronization.) How to copy files that exist in only folder B back into folder A? How to list files that exist in both folders but have different timestamps or sizes? (The ones that have been modified in folder A since last synronization. I would like to avoid using checksums, because there are tens of thousands of files and it'd make the process too slow.) How to make an exact copy of folder A into folder B? I mean, copy everything from folder A into folder B that exists only in folder A and delete everything from folder B that exists only in folder B, but without touching the files that are the same in both folders. UK visit visa: What documents prove genuine relationship with the visitor? Prove $R < ( 1 + (\sum |a_{i}|^{p} )^{q/p})^{1/q}$ for absolute value of polynomial zeros Is it time to be rid of automatic down votes on certain closed questions? I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.  How could I go about doing this? I'm trying to configure a ubuntu server network. [Edit] My ifconfig: lo: flags=73&lt;UP,LOOPBACK,RUNNING&gt; mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10&lt;host&gt; loop txqueuelen 1000 (Loopback Local) RX packets 352 bytes 26160 (26.1KB) RX erors 0 dropped 0 overruns 0 frame 0 TX packets 352 bytes 26160 (26.1KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0  I edited the /etc/network/interfaces file and here is how it is: auto lo auto eth0 iface eth0 inet static address 192.168.15.141 netmask 255.255.255.0 gateway 192.168.15.1  I'm trying to restart the server and I'm using: sudo ifdown --exclude=lo -a &amp;&amp; sudo ifup --exclude=lo -a  This command is an answer from this link:  And I'm getting the following error: Cannot find device &quot;eth0&quot; Failed to bring up eth0.  I'm pretty lay in configuring a server, so I have no idea what's going on. Can someone help me please? Finding distance between consecutive points using ArcGIS Desktop? Consider this:  \documentclass{article} \usepackage[framemethod=TikZ]{mdframed}  \begin{document} \begin{mdframed}[innerrightmargin=0pt] TEXT\end{mdframed} \end{document}   This produces a frame that is much wider than its content:    I know this is not a bug: the mdframed documentation mentions a userdefinedwidth parameter that defaults to \linewidth. But how can I get a mdframed frame that has the same width as its content?   (What I actually need is a box with rounded corners and shading options; breaking over multiple pages isn't necessary. mdframed seemed like the easiest way to get the box, but if it's too much hassle to make it size to content, it would be useful to know so I can try pure tikz.) Prove that if $ f\mathrm{(}z\mathrm{)} $ is analytic at the infinity  ,then :  $ {\lim}_{{z}\mathrm{\rightarrow}\mathrm{\infty}}{f}\prime{\mathrm{(}}{z}{\mathrm{)}}\mathrm{{=}}{0} $ "Least Astonishment" and the Mutable Default Argument My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.  How do I change the MAC address for a network connection?