Solved

VC++.net hello world

Posted on 2007-04-09
11
217 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 500 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
Technology Partners: 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

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!

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 and create new code templates in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

688 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