Sunday, May 10, 2009

Create the sine function without libraries in C++?

ive heard that you can make the sine function without the math library. you have to use something like x-x^2/3!...

Create the sine function without libraries in C++?
Yes! You absolutely can. In fact, all the standard c libraries are simply code that is/was re-written again and again and again, so they finally made it part of the standard library.





//caveat: example only...math is from your own question





double _my_sine(double x)


{


return x-( (x*x) / (1*2*3) );


}





Now, please note we've given this, our sine() function, a unique name that is different than the standard C's math library function...calling this one "_my_sine()".





This is important so the compiler gets/uses the correct sine function, and that we also know which one we're using...
Reply:Dear, Its A Math Question, Not Programming :(


I Really Can Understand That It Is An Assignment Or Something Like That





I Know That Your Instructor Wants You To Understand From Where This Comes From, But I Believe Rewriting Algorithms Will Not Be Useful As Searching To Create New Ones








http://www.homeschoolmath.net/teaching/s...





Hope This Help





You Have To
Reply:Um, to the previous answerer, you don't HAVE to capitalize every word in a sentence.





The definition of function Sine(A) is, for any right triangle with one angle equaling angle A is





Opposite


Sin(A)= ------------


Hypotenuse





You do know what those are, right? (Hypotenuse is opposite the right angle, Opposite is opposite angle A).





UNfortunately, the only ways I know of defining sine are by using other trigonometric functions.


Pi 1


Sin(A)= Cos(------- - A) = ----------


2 csc A





Edit: Follow the site listed below, this text editor doesn't preserve the spacing for the dividing.


Why isn't there a biginteger class in C++ standard libraries?

I know there are many third party extentions that allow big integer like in Java, but why isn't in the the standard libraries?

Why isn't there a biginteger class in C++ standard libraries?
If you don't count the STL as part of the core language, C++ libraries are pretty sparse. Many things are not included, BigInt support being the least of them. The core C++ language, like C is very thin.
Reply:The C++ standard libraries (C/C++ in general, really) are intended for fairly low-level application design.





Nothing prevents the implementation of an arbitrary length integer class, but the standard types of 64-bit ints (long long) and double precision floats (double) are sufficient for the vast majority of apps while still remaining very close to the hardware.

flower show

Suggestions for C++ development libraries?

I'v been looking for quite a while now, and have found many different types of SDK's (software development kits). The trouble is, that their is to many to pick from and related resorces such as tutorials and instalation guides are difficult to find. Can anyone suggest a SDK that allow C++ programs to be executed without using the .NET framework and an abundent sorce of tutorials ect.... I'm using MS Visual C++ 2005 at the mom, if thats any help. thanxs

Suggestions for C++ development libraries?
You can always write C++ programs that don't use the .NET framework. In Visual Studio, select "Win32 application" or "Win32 Console Application" rather than some flavor of managed code to write a traditional compiled program.





SDKs exist to allow you to do a particular task easily. For instance, if I'm writing a game for, say, a mobile computing device there are some great SDKs that make that job a LOT easier. Most SDKs have tutorials associated with them. But you are never REQUIRED to use an SDK; you could, in principle, do everything in vanilla C if you want. No tutorials for that but there are plenty of programming books for C and C++.


How can C++ applications / libraries be combined with Java apps?

The idea is to reuse existing C++ code in a new Java project. If we could combine C++ %26amp; Java, we will not need to rewrite our C++ code in Java.

How can C++ applications / libraries be combined with Java apps?
Use JNI (Java Native Interface) http://java.sun.com/j2se/1.4.2/docs/guid...





The details are far too complex to get into here, but there are plenty of resources online about how to use JNI to call C++ code just search for 'JNI c++'


C++ Headers, libraries, oh so hard to understand?

Please can you explain very clearly what header files and libraries are?

C++ Headers, libraries, oh so hard to understand?
Header files are those .h files that you use to include variables and function definitions (and at times code.) For example,


#include %26lt;stdio.h%26gt;


tells the compiler to "include" the stdio.h file into the source upon compilation.





A library is typically a collection of object files, functions if you will, to perform some functionality. For example, you may have an SQL library that you link with your program which includes all the functions necessary to connect to and interact with a database.


I am new to windows programming. How do i Install C++ libraries in Windows like we do in Unix.?

The libraries are in a folder (like \Lib) when you install the compiler. Most are automatically included when you use an IDE. If you compile via a command line, they are included in the link stage like:





link /LARGEADDRESSAWARE d3d9.lib dxerr9.lib winmm.lib d3dx9.lib kernel32.lib bufferoverflowu.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo

I am new to windows programming. How do i Install C++ libraries in Windows like we do in Unix.?
Use the Microsoft platform SDK


http://www.microsoft.com/msdownload/plat...





also, don't forget to follow it's instructions on how to install it into visual c++ EE or any other program.

phone cards

"Which C/C++ libraries are the fastest at multiplying very sparse matrices?

Each matrix is approximately 500 MB. Dimensions are roughly 2 million rows by 2 million columns. I'm only planning to use a single x86 processor, and I'd like to use either gcc or g++ as a compiler.





I've been considering SparseLib++, but I can't find any reviews of it. Is there something more mainstream?

"Which C/C++ libraries are the fastest at multiplying very sparse matrices?
SparseLib++ is good


else


why do not you write the code youself using


linklist multiplication?


What is the difference when programming for xp or vista in c++?libraries/.net win32. help!?

Right now i'm learning win32 on dev-c++ and it's hard without a visual developing environment like vc6 or vb5. Is there a difference when programming for xp or vista?

What is the difference when programming for xp or vista in c++?libraries/.net win32. help!?
Microsoft offers a very powerful .NET Framework for Windows XP and beyond. Microsoft Visual Studio 2005 Express edition for C++ or for C# are powerful development environments (Express editions are downloaded for free). The C++ version encourages you to write "safe" code. That means you cannot use pointers. However, you can write unsafe code and use pointers in this language.





The framework automatically cleans up resources/memory when you do not explicitly use pointers.





Microsoft has been very successful in offering a very powerful set of framework features. I recommend you go on to learn what Microsoft .NET Framework has to offer developers. C# is a successful threat to Java.
Reply:why is it difficult wthout vc6 or vb5? there are some free IDEs available.





there's some difference between XP and vista. Vista's security model is very strict - if you're not an elevated user (administrator), you're not allowed to store files in some directories, or create registry entries. Also, the firewall can make problems if you use the internet. XP is not that strict.





but in most cases a program will run fine on vista if it was written for XP.


Could some one suggest good c++ libraries for scoket programming?

could anybody suggest me good tutorials for winsock programming using c++...............

Could some one suggest good c++ libraries for scoket programming?
http://netclass.sourceforge.net/





or





http://www.alhem.net/Sockets/


Visual C++ libraries and headers?

I have just started working with MS Visual C++ 2005 Express edition. I have previously used some old C++ (not visual) with objects. My question is, I try using the old header files such as #include "iostream.h " but it returns a fatal error and will not build. Are these no longer supported by VC++ and have their contents been included in the all new "stdafx.h"? If this is the case I will remove anything relating to "iostream.h".

Visual C++ libraries and headers?
It does not matter at all what is supported by VC++ ver.xxxx.


What is really significant -- what is supported by C++ standard.


One of changes is: instead of


#include %26lt;stdio.h%26gt;


you need


#include %26lt;cstdio%26gt;.


Stupid but... new standard...


By the way, mesun1408 is quite right: you need %26lt;%26gt; instead of ""!
Reply:Check the doc... for iostream you should use #include %26lt;iostream%26gt; (without any .h). Beware that the "new" iostream is not the one from "standard c++" but it has also the "old" functionality. I let to you to find out why you don;t need the .h ...:D
Reply:have you tried %26lt;%26gt; instead of quotes?
Reply:Use this instead :





#include %26lt;iostream%26gt;





using namespace std

orange

C++ database libraries for MySQL connection?

I am working on a windows environment, I have a MySQL database (5.0), the compiler I am using is visual C++, I want to connect to the database, query the database, populate data using C++ code, are there any libraries available for this, if not does anyone know about any sample code/tutorial that can help is writing code to establish database connectivity.

C++ database libraries for MySQL connection?
You can use the mysql ODBC drivers


http://dev.mysql.com/downloads/connector...





Then use the ODBC classes provided in Visual C++





Or, if you want pure native C++ classes, check out


http://tangentsoft.net/mysql++/





Have fun


C++ and Libraries(DLL's)?

http://www.learncpp.com/cpp-tutorial/a1-...


I need a tutorial such as this but much more in depth with examples on more than one. I have learned C++ syntax already.

C++ and Libraries(DLL's)?
depending on your compiler, it can be a manual process or not, if you're using Borland Builder or MSVS there should be a dll wizard otherwise you'll have to write it manually.





MSVC - http://logix4u.net/Programming/vc++/A_Tu...





Borland Builder - Look at the help files





another link http://wiki.tcl.tk/2419





All dll have similar entry points, so seeing enough code shold give you the basic idea


Libraries for C?

Can anyone explain or give a site about how to make c libraries step by step. The teacher gave no instruction and our book does not cover it. Thank you

Libraries for C?
The way you make libraries depends on the C compiler you're using.





Since you didn't mention your compiler I can only give you the concept.





First you need one or more header files with all external variables and functions of your library.





Then you need .c files that implement the functions. Private functions and global variables you don't need outside of the library you should mark as "static".





Then you invoke the C compiler with the "compile only" option .


"cc -c myfile.c" on Unix. this will give you a .o file under Unix or a .obj under Windos.





These .o resp. .obj files can be merged into a library.


On a Unix box you use the "ar" program, don't know what it's called on windows.
Reply:C Libraries are simply compiled programs that can be linked using a compiler to your current application. This is done, typically, for classes that you'd be using over and over (for example maybe a StringTokenizer). This allows for re-use of code.





This site can tell you how to compile your files into an archive file for library use.


http://publib.boulder.ibm.com/infocenter...
Reply:Well it is obvious the teacher wanted you to think about it. and obviously she has been talking on what sort of library .





This is one example





You know what files are and folders you can make a library out of them first folder name it library, then do AZ with folders inside,