Defendant raised two questions before this Court: (1) whether the trial court erred in denying his motions at the close of the State’s evidence and at the close of all the evidence to dismiss the charge of attempted robbery with a dangerous weapon, and (2) whether the trial court committed reversible error by inadequately instructing the jury in regard to his sole defense. We find the first question dispositive of the matter before this Court and we therefore do not reach the second question.
Defendant Joe David Allison was indicted and jointly tried with codefendant Donnie Welch on charges of attempted robbery with a dangerous weapon (attempted armed robbery) and first degree murder of store owner Paul H. Clemmer. Allison moved for dismissal at the close of the State’s case. The murder charge against Allison was dismissed, but the attempted armed robbery charge was not. Allison offered no evidence. After codefendant Welch’s evidence was completed, Allison renewed his motion to dismiss the attempted armed robbery charge. This motion also was denied. Allison was convicted by the jury of attempted robbery with a dangerous weapon and received the statutory minimum fourteen year sentence. Codefendant Welch was convicted of both charges and received consecutive sentences of life plus twenty years. Welch’s convictions and sentences were upheld on direct appeal by this Court. State v. Welch, 316 N.C. 578, 342 S.E. 2d 789 (1986).
Defendant Allison appealed to the Court of Appeals which found no error in an opinion reported per N.C. R. App. P. 30(e). Defendant’s petition for a writ of certiorari to review the decision of the Court of Appeals was allowed by this Court on 4 June 1986.
The State’s evidence showed that in 1982 defendant, an illiterate man with a learning disability, became a drug informant for the Gaston County Police Department as a substitute for Barbara Allison, his wife. Mrs. Allison, in exchange for dismissal of forgery charges against her, had agreed to act as a drug informant but quit when undercover agent Detective William Durst’s participation in an arrest exposed her identity. Detective Douglas Ivey, Allison’s contact with the police department, instructed Allison not to originate or instigate any criminal scheme or plan but to go along with any such scheme or plan proposed to him *94and relay information to Ivey. Allison operated under the code name of “Terry,” the name of a relative and therefore easy for him to remember. The charges against Mrs. Allison were dropped after Allison provided Ivey with information which led to search warrants for drugs. However, Allison continued to supply Ivey with information on drugs in exchange for pay.
When arrested for breaking and entering in May of 1983, Allison was approached by Lt. Robert Stacey of the Gaston County Police. Lt. Stacey requested that Allison supply Detective Ivey with information about drug crimes and other crimes, in particular break-ins at grocery stores possibly involving Donnie Welch. Detective Ivey reiterated Lt. Stacey’s request and told Allison that the district attorney had agreed to take his role as an informant into consideration in prosecuting the breaking and entering charge pending against him.
On 30 June 1983 at about 6 p.m., Donnie Welch came to Allison’s house. He told Allison that at 10 p.m. he planned to rob a store located on the edge of Belmont and wanted Allison to drive for him in return for one-half of the robbery proceeds. Welch would not, however, reveal the name of the store or its exact location. Allison called his wife and asked her to accompany him to the store “to get a coke.” Once in the car, Allison told her that he wanted to call Detective Ivey from a pay phone to inform him about the robbery proposed by Welch. Allison called Detective Ivey from a convenience store phone booth. Ivey was out. Allison left his code name, the phone number of the booth and a message requesting Ivey to return his call. Detective Durst, who was at the time dining with Detective Ivey, received the message and returned Allison’s call. Allison, because of his distrust of Durst stemming from the previous exposure of Mrs. Allison as an informant, did not report the proposed robbery to Durst. Instead Allison fabricated a story about marijuana information and told Durst to have Detective Ivey call back at the phone booth. Allison waited at the booth for Ivey’s call, called the police department several more times, again leaving messages for Ivey to return his call and, after forty-five minutes — worried that Welch had become suspicious — returned home without having talked with Ivey. Before the Allisons got home, Allison asked his wife to call Detective Ivey and give him all the information which Allison had concerning the robbery proposed by Welch.
*95Once back at the house, Welch instructed Allison to change the license plate on the Allison car. Allison complied. As Welch and Allison were about to leave the house, Allison secretly told his wife to call and inform Detective Ivey that Welch was going to rob a store on the edge of Belmont around 10 p.m. Allison and Welch left the house between 7 p.m. and 7:30 p.m. Upon Welch’s request, Allison drove to a third party’s house where Welch borrowed a shotgun.
About ten to fifteen minutes after the two left the Allison home, Mrs. Allison received a call from Detective Ivey. Mrs. Allison told Ivey that her husband and Welch had left together in her automobile, which she described, and that Welch planned to rob a store somewhere on the edge of Belmont at 10 p.m. She also informed Detective Ivey that defendant Allison had told her to reveal this information to him.
The information supplied by Mrs. Allison was relayed to Lt. Robert Stacey who in turn called the assistant district attorney, George Hill. Stacey told Hill that he had learned through an informant that a possible robbery was to take place; Stacey also inquired whether the informant’s going along would constitute entrapment. Hill advised that it would not constitute entrapment but the risk of injury was too great and the whole thing should be called off. Lt. Stacey then took steps to stop the robbery. He broadcasted a radio message to members of the Gaston County Police Department warning of the possible robbery and ordering the officers to intercept Allison and Welch.
At 10 p.m. Donnie Welch entered Clemmer’s Superette wearing a stocking mask and armed with a shotgun. Allison remained in the car. Welch demanded money and when the store owner, Mr. Clemmer, reached for his gun, Welch shot and killed him. Welch ran out of the store and got into the Allisons’ car, and defendant Allison drove away.
Detectives Durst, Ivey and Lt. Stacey, patrolling in an unmarked car, spotted the Allisons’ car on Interstate 85. They pulled alongside the car and motioned to Allison to stop. Allison did so immediately. Both men were arrested and charged with attempted armed robbery and murder. Allison, however, continued to cooperate with the officers. He gave a statement to the police detailing his and Welch’s activities. He helped the police officers *96with the search for physical evidence and voluntarily let the officers into his home where he found for them the two pieces of pantyhose that Welch had discarded from his mask.
The dispositive question on this appeal is whether the trial court erred in denying defendant’s motions to dismiss.
It is well settled that upon a motion to dismiss in a criminal action, all the evidence admitted, whether competent or incompetent, must be considered by the trial judge in the light most favorable to the State, giving the State the benefit of every reasonable inference that might be drawn therefrom. Any contradictions or discrepancies in the evidence are for resolution by the jury .... The trial judge must decide whether there is substantial evidence of each element of the offense charged. Substantial evidence is such relevant evidence as a reasonable mind might accept as adequate to support a conclusion ....
The trial court in considering such motions is concerned only with the sufficiency of the evidence to carry the case to the jury and not with its weight .... The trial court’s function is to test whether a reasonable inference of the defendant’s guilt of the crime charged may be drawn from the evidence ....
Defendant was charged with attempted robbery with a dangerous weapon in violation of N.C.G.S. § 14-87. One of the elements of an attempt to commit a crime is that defendant have the intent to commit the substantive offense. State v. Irwin, 304 N.C. 93, 282 S.E. 2d 439 (1981); State v. Smith, 300 N.C. 71, 265 S.E. 2d 164 (1980). An attempted robbery with a dangerous weapon occurs when a person, with the specific intent to unlawfully deprive another of personal property by endangering or threatening his life with a dangerous weapon, does some overt act calculated to bring about this result. See State v. Irwin, 304 N.C. 93, 282 S.E. 2d 439; see also, State v. May, 292 N.C. 644, 235 S.E. 2d 178 (1977). Defendant contends that there was no substantial evidence that *97he had the requisite specific intent to unlawfully deprive the store owner of personal property and therefore the evidence was insufficient to overcome his motions to dismiss. We agree.
The uncontradicted evidence presented by the State showed that the defendant had been asked by the Gaston County Police to act as an informant about break-ins at grocery stores possibly involving Donnie Welch. Shortly after learning of Welch’s plans to rob a convenience store, Allison slipped away and attempted by telephone to reach his police contact, Detective Ivey. Failing in this, Allison left several messages requesting Detective Ivey to call him back. In addition, Allison, before leaving his home with Welch, instructed his wife to call and inform Detective Ivey of all the details of the planned robbery known to Allison at the time. Following the robbery, Allison, upon instruction by the officers who were in an unmarked police vehicle, immediately stopped the car in which he and Welch were travelling, and thereafter cooperated fully with the officers in gathering evidence.
Viewing all the evidence as we must in the light most favorable to the State, we hold that the uncontradicted evidence offered by the State in this case, that Allison informed the police of the intended robbery beforehand and later assisted the police in gathering evidence, does not permit a reasonable inference that defendant had the specific intent to unlawfully deprive the store owner of his personal property.
In a similar case in Illinois, Price v. People, 109 Ill. 109 (1884) (reversing a conviction on grounds that defendant lacked criminal intent), the defendant went to a constable on the day of an intended burglary and told him where and what time the offense was to be committed. The defendant then actually participated in the burglary and afterwards cooperated with the police in apprehending his confederates. The Illinois Supreme Court found that his actions in informing the authorities about the crime before it happened, taken together with his cooperation after the crime, negated any possible criminal intent on the defendant’s part. The court reasoned in Price: “That a sane person, really guilty of committing so grave a crime as the one imputed to the accused, would thus act, is so inconsistent with all human experience as not to warrant the conviction of any one under the circumstances shown.” Id. at 112. Similarly, the evidence presented by the State *98in the instant case, that Allison informed the police of the intended robbery beforehand and assisted in gathering evidence after-wards, negates the requisite criminal intent since it manifestly shows that defendant intended that the Gaston Police foil the efforts of Welch to unlawfully deprive the store owner of his personal property.
The State ordinarily is not bound by the adverse testimony of its witnesses but may offer other contradicting evidence. State v. Robinson, 229 N.C. 647, 648, 50 S.E. 2d 740, 741 (1948). “[However, [when] the State’s case is made to rest entirely on testimony favorable to the defendant and there is no evidence contra which does more than support a possibility or raise a conjecture, demurrer thereto should be sustained.” Id. at 649, 50 S.E. 2d at 741.
In the instant case the State presented no evidence which contradicted its evidence that this defendant lacked the requisite specific intent for attempted armed robbery. Defendant offered no evidence. The State has thus failed to produce substantial evidence of Allison’s specific intent to unlawfully deprive the victim of personal property, an essential element of attempted armed robbery. Thus, the trial court erred in denying defendant’s motions to dismiss.
The decision of the Court of Appeals finding no error in defendant’s conviction and sentence for attempted robbery with a dangerous weapon is therefore reversed.