// Lab0Inventory.cpp : Starter lab
//Anastasia Glyantseva
#include "stdafx.h"
#include <fstream>
#include <iostream>
#include <iomanip>
#include <sstream>
//#include "MemTracker.h"
Type: Posts; User: hotshotennis
// Lab0Inventory.cpp : Starter lab
//Anastasia Glyantseva
#include "stdafx.h"
#include <fstream>
#include <iostream>
#include <iomanip>
#include <sstream>
//#include "MemTracker.h"
Thank you for your input! It is a C->C++ conversion. However, we are to leave the allocations, printf's, etc alone for now. (That will be the next assignment). The structures shouldn't be turned into...
Hello,
this is my first C++ assignment so please bear with me. I need to translate a C program to C by making variables in structures private(no classes yet!) and putting public inline functions....
The header file just has all of the basic stack operations such as: create stack, push/pop stack, delete stack, stack count, etc.
Yep! That's the one. I figured out how to get the input file to work and the header file. But now I need further help figuring out the algorithm.
I need to read through the file line by line and whenever I encounter an 'S' it means that a stock is being sold so I process the 'B'(buys) above it and calculate how many were sold multiplied by the...
This is my input file:
02/15/1995 S 10000 3.71
02/15/1995 B 10000 3.71
02/15/2009 B 1000 16.15
01/27/2011 S 5000 28.87
09/02/2011 B 100 25.80
09/06/2011 B 500 25.51
09/08/2011 S ...
That was just a typo. I do have the header written as #include "stackADT.h". It still doesn't recognize it. But I need that header to write the program.
Hello,
I'm having trouble understanding what one of my assignments requires me to do. This is a data structures ADT program. I tried emailing the teacher, but she could only manage to clarify a few...
Yes! Thank you! That's what I did and it worked!
I tried specifying the path with C:\\User\Anastasia\Documents... And a bunch of other methods. Basically using the path that I see when I open that notepad document. I tried adding .txt at the end...
I tried specifying the file path and everything. Its getting really annoying. Do you know where the IDE working directory is for visual studio? Because the user input is really just me. I'm not...
Okay, so I did the printf statement before opening the file and it prints out the file name just fine. When I use the strerror it says "No such file or directory". Any other suggestions?
I've tried specifying the directory path and everything without any luck... Anyone have any ideas? Oh and I removed the & in front of filename for the scanf. I realized that that was an error.
Hey guys, so I have a bit of a silly problem. I'm starting to write a program in MS visual studio that requires me to open a user specified file. I've created the file in notepad, but when I run the...
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define FLUSH while (getchar() != '\n')
// Global Declarations
typedef int KEY_TYPE;
typedef struct
{
Ok, I got rid of locn in binary search. For some reason I thought I needed it to be able to exit my while loop, but I guess not. I got rid of the duplicate lines as well. What do you mean by fix my...
The input files state the number of lines of the file on the very first line.
-No, I am doing this in Unix and compiling with gcc. Thats why its commented out. I'm supposed to use Valgrind, but I'm not quit sure how to interpret what it tells me.
-That code was actually...
** Pointers, Structures, Arrays, Strings, and Dynamic Allocation of Memory
**
**********************************************************************************
This program provides...
#include <stdio.h>
#include <string.h>
#define MAX_TITLE 100
typedef struct
{
int month;
int day;
int year;
}DATE;
I already posted the compiler errors... A bunch of them are warnings about the extra braces for BOOK list and the other one is an error that HEADER has no member named pAry. As for the code, beside...
The *BOOK was a typo. I meant for it to be &BOOK. But this still doesn't not remedy the problem. From what I understand, DATE is supposed to be a structure definition... Honestly, the part with all...
/* Complex Structures 6 Points
Define pHead, a pointer to a structure called HEADER.
This structure contains two fields: a counter (type int)
and a pointer to an array of structures,...
Ok thank you!