I am wondering how to make dup2 to stop writing to a file even after i closed the file when i use close(fd). For instance the last line is still writing to the file, but i want it to write to the...
Type: Posts; User: loso44x
I am wondering how to make dup2 to stop writing to a file even after i closed the file when i use close(fd). For instance the last line is still writing to the file, but i want it to write to the...
hmm its not working it keeps subtracting from the initial value heres my class..
class ProductManager: public sales
{
public:
string productName1;
float price;
int...
im trying to make a variable in a class which changes and doesnt start over from the initial value ... for example if i have int quantity = 500 and subtract 100 the new value will be 400 then i...
it works i discarded the header file and just includded functions.cpp in main.cpp ... thanks
1234
the menu function is in my other c++ file - i put menu() in main now its giving me errors that my other functions are undeclared since menu calls other functions
i revised my header file but now it says menu is undefined..
#define SIZE 50
#include <sstream>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
class store //...
still gives me same error
any1 plz!! my program is due tomorrow
ok say heres my code in once source file..
#include <sstream>
#include <fstream>
#include <iostream>
#include <string>
#include "stdlib.h"
#define SIZE 50 // size of the array
okay the input looks like this
STORE1[0].custnum = 10212
STORE1[1].custnum = 11234
STORE1[2].custnum = 10212
STORE1[3].custnum = 10212
STORE1[4].custnum = 13114
any1 know whats wrong?
i wrote it but something is working incorrectly it stores again at diff locations
here is the code
y is size of STORE1
tmp[0][0].custnum = STORE1[0].custnum;
for(int j=1;j<y;j++) {
tmp[0][0].id = 2
tmp[0][1].id = 2
tmp[1][0].id = 5
tmp[2][0].id = 3
is there an easier way to do this?
id is an int variable of a class - a[0].id thru a[n].id is alrdy filled with product ids and tmp[0][0].id is initialized to a[0]...what i want to do is check to see if each product id is equal in the...
[x][x] is two dimension
sry i revised my thread is it understandable?
say i have an array of size 4
and this is what i want to to...
tmp[0][0].id is initialized to [0].id
if tmp[0][0].id = a[1].id
tmp[0][1].id = a[1].id
if it isnt true go to next statement...
i think that just fills the array to what u want it to be
Hi im trying to write a function which takes the value of an array from a class with custnum variable and compares it with the other values of the array
lets say if i have 4 custnum ids...and...
this program uses fstream
data file
format:
productid productname quantity purchasedate
10212 Nescafe 20 10/12/05
13114 Pepsi 11 10/27/05
11234 Nescafe 14 11/01/05
10212 Nescafe 30...
i modified it to this
for(int x=0;x<line;x++)
{
in_file >> STORE1[x].custnum;
in_file >> STORE1[x].product;
in_file >> STORE1[x].quantity;
...
Hi i have a program that reads data from a file.. if the quantity or date is wrong it would ignore that entry completely for further comparison how would i go about putting only valid types into the...
the problem is that the function nextprev runs twice instead of once not the scanf problem. so when the program runs u see the print statements twice and it wants two inputs.
i took out the default: in the switch statement because the function in the program ran twice so if u were to put n, the program takes in n and a space and becuase u entered a space, u also enter the...
can anybody help me with this problem, the function nextprev() runs twice for some reason and becuase of this there's no way to break out of the look. can someone tell me why it runs twice or how to...