Right this is the program so far.
#include <stdio.h>
#include <stdlib.h> /* malloc, realloc, free */
#include <string.h>
struct record {
int ID;
char data[64];
Type: Posts; User: headshot119
Right this is the program so far.
#include <stdio.h>
#include <stdlib.h> /* malloc, realloc, free */
#include <string.h>
struct record {
int ID;
char data[64];
My last program was built in C++, but I'd rather learn C, I'll do some reading up on user inputs in C. But I basically understand the program, so I'll see if I can knock up the bit to read and write...
Program compiles now :cool:. I even managed to add a third record!!!!! I understand a lot more of the code now I've seen it in action.
Unfortunately I am more used to C++ functions, such as cin...
C:\Documents and Settings\Karl\Desktop\C++\Projects\database\main.cpp||In function `record** create(char*, record**)':|
C:\Documents and...
Thanks for the example, I've had a quick look and I understand most of it I think, I did compile it but I got some errors.
I'll take a better look tomorrow after school, and read up on the...
Thanks for making a demo, I should have time tomorrow to work on a hard coded version of the database.
As in it gave me a wrong answer, variables are named like that as they refer to the part of the program it is used in. Ie I know that A is an angle, and a is a side.
I've read up a bit on structs MK
struct
{
char cname[8];
char sname[16];
char exam[16];
char grade;
Hmm, bit stuck on the Sine rule in C.
This is my statement to work out Sin A of the sine rule ;
SinA1 = ((Sina * sin(SinB * PI /180)) / Sinb) ;
Now I need to inverse sine that statement,...
I assume I could use some sort of multidimensional array to create the database, but how can I save the data once I exit the program? This may be the easier way to do the program initially.
Not particularly familiar with SQL, could Open Office Access be used for the database part, I'm familiar with that.
Just starting out in the C language. Learning it as my first language, and I'm really enjoying it. My first major program is now 95% complete, a little cheat program for people in school for maths...
Is there functionality in the C or C++ library for inverse Sin, Cos, and Tan. I did skim through the C reference site but couldn't find anything, if not is there a workaround?
Thanks guys much appreciated, while that wasn't working I moved onto the quadratic equation and did it with no problems, I must have learnt something :-)
Slaps head against table, why didn't I see that.
EDIT
sorry for all these noobish questions.
else {
cout << "You choose to find...
else {
cout << "Trig mode has been initialized. Do you need to find an angle : yes (1), No (2). Enter you selection now!\n";
cin >> menu;
...
This is why I hate coding sometimes, I make it more complicated than it is, thanks for both of you for the help.
Problem solved, it works.
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
long double A, B, C, X, Y, Z;
I see. So how can I get the program to output it to 2 decimal places?
BTW it did orignally execute under one variable, I changed it to break the calculation down stage by stage In an attempt to...
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
int A, B, C, A1, B1, C1, A2, B2, C2, A3, B3, C3, A4, B4, C4 ;
Makes sense thanks Bithub
If I make it into a block does it solve the problem? Or is there a way so if I select option 1 to run only if statements in a block?
#include <iostream>
#include <string>
using namespace std;
int main()
{
//Main Strings
std::string Password;
std::string AdministratorPassword;
I understand how to open text files, and how to close them. But not use the bit inside so to speak.
Can any one give me a quick run down on how to edit code inside, and use an if statement to...
I realized that, read my second edit in that post.