C++ :: Build Full Computer Algebra System?

Apr 1, 2013

Im trying to build a full computer algebra system in c++

View 1 Replies


ADVERTISEMENT

C++ :: Bool Algebra - Designing Database Query

May 15, 2012

I am designing a database query and need simplification to the algebra:

Code:
((x > u) && (x < y)) || ((z > u) && (z < y)) || ((u > z) && (y < x))

And these are always true:

Code:
z > x
u > y

It's a range overlap algorithm.

View 4 Replies View Related

C++ :: Truth Table Generator - If User Enters String Of Boolean Algebra It Will Output Table

Jan 25, 2013

If a user enters a string of boolean algebra it will ouput the table.

I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.

How to dynamically create the function, how to implement it.

BTW This is a console function, if that changes anything.

View 2 Replies View Related

C :: Reading And Accepting Full Name

Feb 6, 2013

I am having trouble in reading my full name in just a single variable and some kind of authentication. this is my code by the way.

Code:

#include <stdio.h>
int main(void)
{
char NAME_MINE1[40];

void clrscr();
}

[code]....

if i enter my full name i will be able to go on to the next statement/command but when i put on some name (which is not mine) i will automatically get an error and exit the program.If i type "Qwerty You Tube" EXACTLY and not just the first string before the whitespace i will be able to proceed but when i enter "Qwerty Tube You" or "Qazse Qop Queen" i will get an error and the program will exit.

View 6 Replies View Related

C++ :: Get Full Time Without Seconds

Jun 21, 2013

I have a code to check the last time modification of a file using "gmtime". Is it possible to remove the seconds in the result?

Here is my code:

struct tm* clock;// create a time structure
struct stat attrib;// create a file attribute structure
stat("test.txt", &attrib);// get the attributes of afile.txt
clock = gmtime(&(attrib.st_mtime));// Get the last modified time and put it into the time structure

View 6 Replies View Related

C++ :: Not Marking That The Queue Is Full

Apr 11, 2013

Why is this code not marking that the queue is full.. I'm just including my Add function that verifies if they want to add another number to the queue. The isFull function works fine, have used it on other programs.

template <class T> //Template currSize function
int Queue<T> :: currSize ()
{
return (rear - front + arraylength) % arraylength; //

[Code].....

The output goes all the way down to 1 spot left, lets the user enter the last element. Then it asks if they want to add another.. At this point, when they hit Y, it lets them add it and it says there are 5 spots left!

View 8 Replies View Related

C++ :: Getting Full Sentence To Input?

Oct 29, 2013

#include <iostream>
#include <string>
#include <istream>

[Code]....

It seems like my program doesnt want to take in a sentence, only the first word i type in

View 1 Replies View Related

C++ :: Get Full Path Of File?

Nov 26, 2013

I wanted to make my program read the file "input.txt". I did it successfully, but now I want to get the full path of the file "input.txt". Is there any way to do it?

My output should be :

FILE *file;
std::string fullFileName;
file = fopen("input.txt", "rb");
if(file != NULL)
{
// getfullfilename(file, fullFileName);
// std::cout << fullFileName.c_str() << std::endl;
}

View 5 Replies View Related

C++ ::  Getting A Full Path By Using Text File Name

Jan 16, 2014

How to get a full path of a directory only using a text file name? (Btw i am using visual studio not windows)...

View 9 Replies View Related

C/C++ :: How To Store Full Name In Two-dimensional Array

Nov 3, 2014

I'm trying to design a C program that ask the users to type their full name (seperate by a space), and store this name in a two dimensional array. I just want to test if I did it correctly, so i just entered one name and give it a try.

char name[50][2];
printf("enter the neame");
scanf("%s%s",&name[0][0],&name[0][1]);
printf("%s",name);
return 0;

but the program will not print the expected result.

View 4 Replies View Related

C++ :: Create A Pointer To A Full Text Line

Jun 3, 2013

It's really simple to say to a pointer to point to a sigle character or a single number.

Code: int *ptr;
int a = 5;
cout << *ptr << endl;

But I want for example a pointer to change a whole text line. My idea is that the user enters which language he speaks.

Code: cout << "English" << endl;
cout << "Swedish" << endl;

But I don't know how to this. I could have done this without pointers with if statments but I want to do it with pointers because it were a exercise to do.

View 3 Replies View Related

C :: Reading Full Sentence From Stdin And FILE

Sep 12, 2014

I thought maybe there was something in C that could read full sentences from stdin

Code:
scanf("%100[^
]s", string);

But that's not working for me. so i came up with my own function and its not giving me the results i want. here is the function including the call from main:

Code:
/* * * * * * * * * * * * * *
* FROM MAIN *
* * * * * * * * * * * * * */
printf("
Adding a new part...
");
printf("Enter part name: ");
get_string(new_part.pname);

[Code] .....

/* * * * * * * * * * * * * * * * * * * * * * *
* UNDESIRED OUTPUT *
* * * * * * * * * * * * * * * * * * * * * * */
8newpart

Where is the eight coming from? i thought fpurge clear the buffer. Also, I'm trying to add spaces in between words... i thought maybe putting within the while loop but outside of the if statement string[length +1] = '' would work, but it doesn't. so i put it outside of the loop but that i knew that wouldnt work either.

Problem #2 is reading from a file.. so far i have the following code which reads everything perfectly except the .txt file has a new line character at the end and i think its reading it:

Code:
/* * * * * * * * * * * * * * * * *
* READS FROM FILE *
* * * * * * * * * * * * * * * * */

if(read_in != NULL)
{
while ((fgets(read_string, MAX_PARTS ,read_in) != NULL) && (array_position < MAX_PARTS))

[Code] ....

0 in stock i want it to stop after reading the ball bearings line. a lot of issues for one post, but all related to reading inputs so i put it all on one.

View 2 Replies View Related

C++ :: Program To Emulate Full Screen Console

Dec 5, 2013

So, I'm making a program in C++ that emulates a full screen console... I used SetCurrentConsoleFontEx to set the font to 12x16 but it sucks...

Anyway, I read here: [URL] .... that also the console font can be changed, but I can't make it work! How can i set the font to Lucida Console? This is the function I use to change font size:

void setFontSize(int x, int y) {
PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx = new CONSOLE_FONT_INFOEX();
lpConsoleCurrentFontEx->cbSize = sizeof(CONSOLE_FONT_INFOEX);
GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, lpConsoleCurrentFontEx);
lpConsoleCurrentFontEx->dwFontSize.X = x;
lpConsoleCurrentFontEx->dwFontSize.Y = y;
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, lpConsoleCurrentFontEx);
}

View 2 Replies View Related

C/C++ :: Full Menu Not Shown When Running Program

Mar 4, 2014

The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <vector>
using namespace std;
struct menuItem{
string itemDesc;
double price;
int menuType;

[Code] .....

View 3 Replies View Related

Visual C++ :: Enter First And Surname And Then Display Full Name

Sep 21, 2012

I'am new to C++, program is : enter first and surname and then display the full name:

code below:

// Enter first and surname and then display the full name.
#include<iostream>
#include<string>
#include<cctype>
using namespace std;

[Code] ....

View 10 Replies View Related

C++ :: Convert Full Word To Uppercase If It Is Lowercase In A String?

Feb 28, 2014

The problem I am facing is that I have to output the C++ input file and display every line of code in the output, except in the output I have to convert every if, else, and while as IF, ELSE, WHILE. I tackled the first part and now its onto the 'easier' part even t

View 1 Replies View Related

C++ :: Check If Binary Search Tree Is Full Or Not Recursively?

Dec 5, 2013

How would I check if a binary search tree is full or not recursively?? ?

View 1 Replies View Related

C Sharp :: Full Code For Webcam Alert Motion Detector?

Mar 12, 2013

i have webcam i need to make project when this webcam detect any motion in his spot give me alert ,,,

View 4 Replies View Related

C++ :: How To Build A Custom Allocator

Feb 7, 2014

I'm trying to write a custom allocator that I can use with the STL. Here's what I have so far :

Code:
#include <cstddef>
#include <iostream>
#include <memory>
#include <vector>
template<class T>
struct customallocator {

[Code].....

I'm doing and currently, my push_back doesn't seem to do anything.

View 12 Replies View Related

C++ :: Build Own Library (static)

Sep 11, 2014

How to build the static library on my own using visual C++ 2008.

I used the following code to create the header file and cpp of the library.but I am unable to compile due to the following error.

// MathFuncsLib.h
namespace MathFuncs {
class MyMathFuncs {
public:
// Returns a + b
static double Add(double a, double b);

[Code] .....

Error I get while it is compiled :
Error3error C2653: 'MyMathFuncs' : is not a class or namespace name

View 4 Replies View Related

C++ :: Build Events Like Another Languages?

Sep 28, 2013

class test {
private:
string name="";
public:
event void changedname();
void setname(string value)

[code]....

i get error about 'a' and 'b' not be a class. but using a template can i validate these code?

my problem is that i don't know how to use objects outside of functions / these is polymorphism, but not accepted by C++

View 12 Replies View Related

C/C++ :: How To Build Array In A Function

Apr 6, 2014

I need to build an array in a function and return that array. Well, two arrays actually, which means I can't return it in the return statement.

Long term, this function/method is supposed to return two populated buffers for further processing. The buffers/arrays are loaded from a file. So, the size of the array is completely unknown until after the file is read. So, you can't have a fixed size array until the function is almost ready to return.

I'm hardcoding the arrays here for testing purposes, but eventually they will be loaded in from a file. That's the whole purpose of this.

Anyway, I need to pass the arrays that are created in this function/method to the caller. But I can't figure out how to do it. The code "almost" works, except that it's overwriting my array when it returns.

Here's the method:

bool GameModelClass::LoadBuffersFromPUNCFile(std::wstring PUNCFileName, VERTEX* &VertexListPointer, unsigned int* &IndexListPointer) {
VERTEX GroundVertexList[4] = {

[Code]....

VertexListPointer returns the correct data structure (actually its an array of structures). The problem is that the first time I use the other variables it over rights the array. The pointer still points to the same spot, but VertexBufferDescription is next to the VertexListPointer and so completely overwrites it.

What I "think" I want is to allocate the array in a totally different area of memory. VertexListPointer should be a pointer, not a contiguous block of memory. It should point to the contiguous block of memory elsewhere.

This is where my weak understanding of pointers comes back to bite me in the posterior end.

In the end, I just want to pass back two arrays/buffers to be used by the calling code.

View 14 Replies View Related

C++ :: How To Build Binary Tree With Values

Dec 29, 2013

I am not sure how to build the tree with values:

Code:
struct Node *root = 1 root->left = 2
root->right = 3
root->left->left = 4;
root->left->right = 5;

Everything should be right except the main(). How to demonstrate this program correctly?

Code:
#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include <stack> // std::stack

[Code] .....

View 8 Replies View Related

C++ :: Build Min Heap With No Repeating Values

Jul 10, 2013

10,11,20,1512,22,24,19,22

i want to write a c++ program to build min heap which gets above values from user. remember this program should not alloduplicate values to enter. it should discard duplicate values.

View 11 Replies View Related

C++ :: How To Build SMTP Mail Client

Jul 18, 2013

i have four email adresses (for various reasons) and i could probably find a client for all three on source forge, but i thought it would be good practice to use my own. i want to use boost, sdl, and c++, but i cant find a tutorial.

View 2 Replies View Related

C++ :: Build Application That Queries The Database?

Sep 27, 2013

I have lot of C++ API exposed in our project and I want to build an application that queries the database and shows some stuff to the user in the UI.

So, essentially, my main code is in the c++ language. What choices do I have over the UI?. I am interested in showing this UI in the form of a html page lilstening to a port.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved