Certain phases of the litigation involved in this appeal have been before us on two former appeals. The first action was instituted on 5 December, 1949, and the appeal therein was heard at the Spring Term, 1950, and the opinion of this Court, dismissing the action, is reported in 231 N.C. 528, 58 S.E. 2d 104.
The present action was instituted on 24 January, 1952, and was heard at the Fall Term, 1952, on an appeal from the denial of a motion to strike certain allegations in the plaintiff’s reply. The opinion disposing of that appeal is reported in 236 N.C. 230, 72 S.E. 2d 583. The plaintiff thereafter filed a petition to rehear, which was denied. He then petitioned the Supreme Court of the United States for a writ of certiorari to review the opinion of this Court, which was denied. Howland v. *691Stitzer, 345 U.S. 935, 73 S. Ct. 796, 97 L. Ed. 1362. Many of the facts involved in the present appeal are stated in detail in the former appeals and will not be restated except in so far as may be necessary to an understanding of the questions presented for determination.
The plaintiff and the defendant, Mrs. Sherman Haws, Jr., were formerly husband and wife, having been married on 6 January, 1941. Thereafter, on 18 September, 1946, the plaintiff and his wife, Amber Howland (the present Mrs. Hawes), entered into a separation agreement, the terms of which were to remain in force during the life of Mrs. How-land, or until her remarriage. The plaintiff found the terms of this agreement unduly burdensome to him. Therefore, he proposed a new separation agreement by the terms of which, in lieu of the benefits provided in the then existing agreement in favor of his estranged wife, he agreed to give her for life, irrespective of her future marital status, the income from certain stock which is held in trust under a trust indenture by the First National Bank and Trust Company in Asheville, North Carolina. His estranged wife, the present Mrs. Hawes, consented and entered into the new agreement which was executed on 2 April, 1947. The essential parts of this agreement in respect to the income from the stock are set out in the opinion disposing of the former appeal in this action.
Mrs. Howland instituted an action for divorce in the Supreme Court of New York, County of New York, on 13 February, 1947. She was given an interlocutory decree for absolute divorce from William Anthony Hoppin Howland, the plaintiff in the present action, which divorce became absolute on 15 October, 1947. The decree of the New York Court contained the following provision: “That the defendant (the plaintiff herein) shall provide for the support and maintenance of the plaintiff during the entire period of her lifetime in accordance with the terms of an agreement between the parties dated the 2nd day of April, 1947, which said agreement is incorporated in this judgment.”
The plaintiff in this action remarried immediately after the effective date of the above decree. Mrs. Amber Howland later married Charles Stitzer, Jr. This marriage resulted in a divorce and the former Mrs. Amber Howland thereafter married Sherman Hawes, Jr.
The proceeds from the stock referred to in the separation agreement dated 2 April, 1947, were paid to the former Mrs. Amber Howland from 1 May, 1947, until 5 December, 1949, the date on which the first action referred to herein was instituted.
In June, 1950, the plaintiff filed a motion in the Supreme Court of New York, County of New York, requesting the New York Court to modify the decree entered in the original divorce action to the extent it required the plaintiff to support his former wife, on the ground that she *692bad remarried. Tbe motion, was granted and tbe former judgment amended as required in sucb cases upon tbe remarriage of tbe wife. New York Civil Practice Act, Section 1172c. However, tbe New York Court, in striking from its judgment tbe provision for support, entered tbis provision in its decree: . . and it is Further Ordered, tbat tbe disposition of tbe within motion is without prejudice to sucb rights as plaintiff may have pursuant to tbe terms of said agreement between tbe parties dated April 2, 1947.”
Ye shall first consider tbe defendant’s motion to strike. "When tbis cause was before us at tbe Fall Term, 1952, on a similar motion, we held tbat tbe defendant’s motion to strike from tbe plaintiff’s reply all the allegations which attacked the validity of tbe separation agreement entered into on 2 April, 1947, should have been granted, and reversed tbe ruling to tbe contrary.
Tbe plaintiff thereafter obtained permission from tbe court below to file an amended reply. Tbis reply alleges in sum and substance tbat tbe agreement entered into on 2 April, .1947, was merged in tbe decree for a divorce entered in New York and tbe contractual rights thereunder did not survive tbe decree; tbat it was not tbe intention of tbe plaintiff tbat tbe separation agreement should survive tbe divorce judgment or remarriage of tbe defendant Hawes, but, to tbe contrary, it was bis intent tbat it should be merged therein and not survive tbe decree. Therefore, tbe amendments to tbe previously amended reply do raise tbe question of merger, and tbe motion to strike was properly denied.
Tbe refusal to grant tbe motion for judgment on tbe pleadings is not appealable. Erickson v. Starling, 235 N.C. 643, 71 S.E. 2d 384; Rodgers v. Todd, 225 N.C. 689, 36 S.E. 2d 230; Ornoff v. Durham, 221 N.C. 457, 20 S.E. 2d 380; Cody v. Hovey, 216 N.C. 391, 5 S.E. 2d 165.
In tbe instant case, however, tbe appellee conceded in tbe oral argument before tbis Court tbat if tbe separation agreement, dated 2 April, 1947, was not merged in and made inoperative as a contract by its incorporation in tbe divorce decree entered in New York, which became effective on 15 October, 1947, tbe appellant is entitled to judgment on tbe pleadings. In fact, plaintiff’s counsel (Mr. Bothenberg), directed substantially all bis argument before tbis Court to tbe question of merger. Hence, we have decided to exercise our discretionary right to express an opinion on tbe merits of tbe plaintiff’s purported allegations and contentions with respect to tbat defense. Suddreth v. Charlotte, 223 N.C. 630, 27 S.E. 2d 650.
Before reviewing tbe New York cases on tbe question of merger, it might be well to point out tbat if tbe parties to tbe respective separation agreements referred to herein, intended tbat tbe second agreement should be merged into a judgment for support in tbe nature of alimony and no *693more, as contended by tbe plaintiff, then the appellant was almost inconceivably remiss in safeguarding her own rights. Under the original agreement she had the following benefits: (1) The plaintiff was obligated to pay her $4,200.00 per year in equal monthly installments of $350.00, payable in advance on the first of each and every month; (2) the plaintiff was required to procure a policy of insurance on his life in the sum of $25,000, pay the premiums thereon, and to make his wife the irrevocable beneficiary thereunder; and (3) she was to have the use and benefit of an apartment and the effects therein contained, located at 1060 Park Avenue, New York. She gave up all these benefits which had been secured to her for life, or until her remarriage, in exchange for an agreement to the effect that she should receive the income from certain stock, amounting to approximately $1,600.00 per year, for life, regardless of her marital status; and as further evidence of the intention of the parties as to whether such agreement should survive her remarriage, they had the following provisions written therein: “It is . . . agreed between the parties that the payments due hereunder . . . shall commence on the 1st day of May 1947, and shall continue during the lifetime of the party of the first part irrespective of the marital status of the said party of the first part.
“The parties hereto agree that the provisions of this instrument shall remain in full force and effect notwithstanding any action of any nature whatsoever taken by either party in the courts of this State, any other State or in any other Country; and the parties further agree that this instrument and all the provisions thereof shall remain in full force and effect notwithstanding any judgment or decree obtained by either party in this State, any other State or any other Country.
“That each party shall, and will, at any time, or times, make, execute and deliver, any and all further assurances, things and documents, as the other said party shall reasonably require, for the purpose of giving full force and effect to this agreement and to the covenants, conditions and provisions thereof.
“That all of the covenants, promises, stipulations and provisions herein contained shall apply to, bind and be obligatory upon, the heirs, executors, administrators and assigns of the parties hereto.”
In Kunker v. Kunker, 230 App. Div. 641, 246 N.Y.S. 118, while the action for divorce was pending the parties entered into a written agreement in which the husband agreed to make certain monthly payments to his wife during his lifetime for the support of herself and two children. The agreement further provided that in case of the remarriage of the wife, or in case of the death of either or both the children, the husband might apply to the court for a modification of the monthly payments. It was further provided that the agreement was made subject to the *694approval of the court and should be made a part of the final judgment of' divorce to be entered in the action. Among other things, the Court said: “There is nothing in the statute giving jurisdiction to incorporate into the judgment formal private agreements made by the parties as to a division of their property and the like. Agreements or stipulations for support and security therefor, including many details, are sometime included in the judgment if they appear fair, rendering it unnecessary to take proof. So, here, it was possible for the parties to stipulate that certain provisions in the agreement relative to support should be included in the judgment for whatever advantage that might bring, and otherwise that the agreement should remain in force. ... If a contract is made, the courts will not award a different sum. Cain v. Cain, 188 App. Div. 780, 177 N.Y.S. 178; Levy v. Levy, 149 App. Div. 561, 133 N.Y.S. 1084. If there is an existing contract, there is really no necessity for an application for alimony. There have been cases where such provisions have been incorporated in the judgment — for what purpose is uncertain, unless to give an additional remedy by contempt. But they became a part of a judgment separate from the contract.” (Italics ours.) The Court pointed out that the agreement between the parties in the Kunker case contained “no reservation that the contract should endure after it became part of the judgment.”
Likewise in Jaeckel v. Jaeckel, 179 Misc. 994, 40 N.Y.S. 2d 491, the agreement with respect to support was entered into while the action for divorce was pending, and it provided that if the wife succeeded in her action the amount agreed upon should be incorporated in the final decree. The Court said: “So far as the defense of merger is concerned, where there is an intention to merge the agreement as to alimony in the decree and the decree embodies the agreement as to alimony, no right to enforce the alimony provisions of the agreement survives the decree. Chester v. Chester, 171 Misc. 608, 13 N.Y.S. 2d 502; Zatz v. Zatz, App. T. First Dept., 173 Misc. 229, 17 N.Y.S. 2d 553. . . .” The Court further said, however, that “In Bell v. Bell, 171 Misc. 605, 13 N.Y.S. 2d 500, an action on the contract fixing the amount of permanent alimony was upheld because the contract explicitly provided that ‘this agreement shall still remain in full force and effect unless mutually modified or cancelled by the parties hereto, and this agreement may be incorporated in any decree of divorce or separation made by any court of competent jurisdiction.’ ”
In the case of Schmelzel v. Schmelzel, 287 N.Y. 21, 38 N.E. 2d 114, the parties entered into a separation agreement which provided that the terms thereof should be incorporated in any judgment in any action between them wherein provision was made for the support of the wife. Thus the separation agreement expressly contemplated a suit for separa*695tion in tbe future. Later tbe wife was granted, a divorce. Tbe decree required tbe parties to comply witb tbe provisions of tbe separation agreement. Tbe financial situation of tbe defendant busband having improved, tbe plaintiff, two and one-balf years after tbe entry of tbe original decree, made a motion for an order to increase tbe alimony. Tbe motion was allowed and tbe alimony increased. Tbe defendant appealed and tbe Court of Appeals of New York, in reversing tbe lower court, said: “-In tbe case at bar tbe final judgment of separation did not terminate tbe separation agreement, but as in tbe case of Goldman v. Goldman, 282 N.Y. 296, 26 N.E. 2d 265, 269, tbe judgment entered incorporated tbe terms of tbe separation agreement, wbicb included fixing tbe amount of alimony for tbe support of tbe wife. Sucb incorporation was made pursuant to an express provision of tbe separation agreement. In sucb event, as tbe court pointed out in tbe Goldman case, Tbe direction of tbe court tbat tbe defendant shall pay to tbe plaintiff a sum less than be agreed to pay does not relieve tbe defendant of any contractual obligation’ and Tbe plaintiff may still resort to tbe usual remedies for breach of a contractual obligation if there has been sucb a breach,’ since To long as tbe contract remains unimpeached, tbe court will not compel tbe busband to pay to tbe wife for her support a sum greater than tbe wife agreed to accept, at least where sucb sum is not plainly insufficient.’ Goldman v. Goldman, supra, 282 N.Y. at page 301, 305, 26 N.E. 2d at page 267. Tbe decision in tbe Goldman case reaffirmed tbe rule as announced in tbe cases of Galusha v. Galusha, 116 N.Y. 635, 22 N.E. 1114, 6 L.R.A. 487, 15 Am. St. Rep. 453; Id., 138 N.Y. 272, 274, 33 N.E. 1062, tbat a decree or a subsequent order in a matrimonial action does not destroy the agreement or deprive the parties of their rights thereunder(Italics ours.)
In Graham v. Hunter, 266 App. Div. 576, 42 N.Y.S. 2d 717, tbe parties entered into a separation agreement on 31 December, 1932. Thereafter, tbe busband went to Nevada and obtained a divorce in February, 1933. Tbe Nevada decree ratified, confirmed, and approved tbe separation agreement and adopted it in all respects. The former busband met tbe annual payments required under tbe separation agreement and tbe Nevada decree until bis former wife remarried in July, 1941. From tbat time, be refused to make any further payments. Tbe action was instituted to recover tbe balance alleged to be due for tbe remainder of tbe year 1941 under tbe separation agreement and the decree of tbe Nevada divorce. Tbe lower court held tbat there was a triable issue as to whether or not payments by tbe busband were to be terminated upon tbe remarriage of tbe wife. Tbe wife contended tbat tbe terms of tbe separation agreement and of tbe decree were unambiguous and tbat their meaning and construction presented a question of law for tbe court and not an issue of fact to be determined upon a trial. Tbe Court held tbat tbe pro*696visions of the agreement manifested an intention of the parties that the payments to be made each year were not to cease upon the remarriage of the wife.' The order of the lower court was modified and plaintiff’s motion for summary judgment allowed. Cf. Sureau v. Sureau, 280 App. Div. 927, 116 N.Y.S. 2d 470; s.c., 305 N.Y. 720, 112 N.E. 2d 786.
It is settled law that where the terms of a written instrument or contract are explicit, the court determines their effect by declaring their legal meaning. Wilson v. Cotton Mills, 140 N.C. 52, 52 S.E. 250; Strigas v. Insurance Co., 236 N.C. 734, 73 S.E. 2d 788, and cited cases. Furthermore, the construction of a contract does not depend upon what either party thought, but upon the agreement of both. Brunhild v. Freeman, 77 N.C. 128; Wilson v. Scarboro, 163 N.O. 380, 79 S.E. 811. “The heart of a contract is the intention of the parties, which is to be ascertained from the expressions used, the subject matter, the end in view, the purpose sought, and the situation of the parties at the time.” Electric Co. v. Insurance Co., 229 N.C. 518, 50 S.E. 2d 295.
In the instant case, it is crystal clear, we think, that plaintiff and his former wife, now Mrs. Hawes, the appellant herein, intended that the provisions contained in the separation agreement executed by them on 2d April, 1947, should survive any decree for divorce, alimony, or remarriage of the appellant. The agreement so provides in unambiguous terms. Therefore, in light of the above decisions of the New York courts, it is’our opinion that the agreement was not merged with the divorce decree in New York, but on the contrary, is a valid and enforceable contract. Stanley v. Stanley, 226 N.C. 129, 37 S.E. 2d 118.
The ruling of the court below on the defendant’s motion to strike is affirmed, and the cause is remanded for further proceedings agreeable to law.
Affirmed.