?
Solved

VC++.net hello world

Posted on 2007-04-09
11
Medium Priority
?
222 Views
Last Modified: 2013-12-14
Hi, i am having some problems with using visual C++.net express edition or is it i am not coding correctly.
I tried to use the pause(); in stdio.h but it gave me an error. and i tried to compile a simple code with a simple function. It didn't work too , it gave me an error...unable to resolve int____ add(y@@@y@@@)

Here's my code

#include <stdio>
#include <iostream>

using namespace std;

int adding(int a,int n);
int main()
{
      int answer = 0;

      int a = 10;
      int b = 10;

      answer = adding(a,b);
      cout << answer;
      pause();
      return 0;
}
0
Comment
Question by:jaxrpc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 18877329
       #include <stdio>

should be :

        #include <cstdio>

Also, add this header :

        #include <cstdlib>

and use :

        system("PAUSE");

instead of :

        pause();
0
 

Author Comment

by:jaxrpc
ID: 18877343
hi infinity08,

but why is it that in some book examples it is stated as #include <stdio>
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 2000 total points
ID: 18877361
I don't know about .NET, but in C++, there's no such header. It's either :

       #include <stdio.h>

or :

       #include <cstdio>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jaxrpc
ID: 18877372
hi , what i meant was #include <stdio.h> because i read that if using ansi C++ there's no need to add the .h. am i right about it?
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 18877380
>> because i read that if using ansi C++ there's no need to add the .h. am i right about it?

See my last post ...
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 18877397
btw, can you show the whole code ? Where did you implement the adding function ?
0
 

Author Comment

by:jaxrpc
ID: 18877402
hi, i implemeneted the add function below the main. i guess my problem is with the header file. thanks
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 18877416
>> hi, i implemeneted the add function below the main.

Can you show it anyway ? I want to check out the "unresolved symbol" error you got ...
0
 

Author Comment

by:jaxrpc
ID: 18877426
int adding(int a, int n)
{
      int answer = 0;
      answer = a + n;

      return answer;
}

thanks
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 18877434
Ok ... looks fine ... Does the code compile and run without problems now ?
0
 

Author Comment

by:jaxrpc
ID: 18877443
yup it does now. Really appreciated your help. thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question