-
ODD error(s);
Ok heres the errors, now bear in mind that the program WORKS...i get these after i close it.
Code:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
The thread 0xE4C has exited with code 0 (0x0).
The program 'C:\Program Files\Microsoft Visual Studio\MyProjects\ACIWork1\Debug\ACIWork1.exe' has exited with code 0 (0x0).
heres the program code....
Code:
/* Steven Billington
December 8, 2002
ACIWork1.cpp
First assignment from ACI, December 4, 2002.
Program uses two ref parameters to multiply an
int and a double.
*/
#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h> //for pause
/* Prototype function*/
int multiply(int &val1, double &val2);
int main(int argc, char* argv[])
{
int f_val;
double s_val;
cout<<"Enter an integer value: ";
cin>>f_val;
cout<<"Enter a double value: ";
cin>>s_val;
cout<<setiosflags(ios::fixed | ios::showpoint | ios::right)
<<setprecision(2);
cout<<"You originally input: \n";
cout<<"\n"<<f_val<<"\t"<<s_val
<<endl;
cout<<"\nThe product of these two values is: \n";
cout<<"\n"<<multiply(f_val,s_val)
<<endl;
system("pause");
return 0;
}
int multiply(int &val1, double &val2)
{
double product;
product = val1 * val2;
return product;
}
-
what else have you included in stdafx.h ?
just copy that code too, we'll need it to compile
-
i didn't include anything in it, thats there from the "simple project" option in VS 6.0 that i have never used before, i normally type the whole code sheet myself.
here it is anyway:
Code:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__1961167C_A423_42EB_A89C_6BF8163D0599__INCLUDED_)
#define AFX_STDAFX_H__1961167C_A423_42EB_A89C_6BF8163D0599__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__1961167C_A423_42EB_A89C_6BF8163D0599__INCLUDED_)
-
But this other program works FINE no errors WTF!
Code:
/* Steven Billington
December 7, 2002
ACIWork2.cpp
Program from ACI Assignment, December 4, 2002.
Program uses and int and a double with two
ref parameters, adds 2 to each value and returns
them to the main function.
*/
#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h>
void add(int &val1, double &val2);
int main(int argc, char* argv[])
{
int f_val;
double s_val;
cout<<"Enter an integer value: ";
cin>>f_val;
cout<<"Enter a double value: ";
cin>>s_val;
cout<<setiosflags(ios::fixed | ios::showpoint | ios::right)
<<setprecision(2);
cout<<"\nOriginal values were: \n";
cout<<"\n"<<f_val<<"\t"<<s_val
<<endl;
add(f_val,s_val);
cout<<"\nNew values are: \n";
cout<<"\n"<<f_val<<"\t"<<s_val
<<endl;
system("pause");
return 0;
}
void add(int &val1, double &val2)
{
val1 += 2;
val2 += 2;
}
-
well first of all you're returning a double from a function designed to return an int, i changed that, it compiled and ran just fine.
Code:
/* Steven Billington
December 8, 2002
ACIWork1.cpp
First assignment from ACI, December 4, 2002.
Program uses two ref parameters to multiply an
int and a double.
*/
#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>
#include <stdlib.h> //for pause
/* Prototype function*/
double multiply(int &val1, double &val2);
int main(int argc, char* argv[])
{
int f_val;
double s_val;
cout<<"Enter an integer value: ";
cin>>f_val;
cout<<"Enter a double value: ";
cin>>s_val;
cout<<setiosflags(ios::fixed | ios::showpoint | ios::right)
<<setprecision(2);
cout<<"You originally input: \n";
cout<<"\n"<<f_val<<"\t"<<s_val
<<endl;
cout<<"\nThe product of these two values is: \n";
cout<<"\n"<<multiply(f_val,s_val)
<<endl;
system("pause");
return 0;
}
double multiply(int &val1, double &val2)
{
double product;
product = val1 * val2;
return product;
}
-
on that second program you posted,
change the void function to a double and return a double.
-
I'm usually not that careless, i'm sick tho. Thanks alot, i'm going to go be sick in school now, gotta keep my perfect attendence ya know.
Thnx again.