Here we go::
#include<stdio.h>#include<string.h>
#include <stdlib.h>
void case1();
void case2();
void case3();
Type: Posts; User: dan.goodridge
Here we go::
#include<stdio.h>#include<string.h>
#include <stdlib.h>
void case1();
void case2();
void case3();
ok ive done a case fuction and i still dont have the results printed out to screen but the other functions work.
it was to print results then end program
o i have the break in the wrong place it just jumps to case 4 with it being at that point
heres the code
case 3: printf("Lists stock\n");
{
FILE *fp; //file pointer
fp=fopen("stock.txt","r");
stock mylist[50];
when i put in curly brackets it jumps the printf statement and goes straight to break.
ok edited it
case 3:
printf("Lists stock\n");
{
FILE *fp; //file pointer
fp=fopen("stock.txt","r");
stock mylist[50];
then it just prints out loads of random numbers
case 3:
printf("Lists stock\n");
{
FILE *fp; //file pointer
fp=fopen("stock.txt","r");
stock mylist[50];
is there an easier way to print out my entire text file?
I have this error 'realloc' : cannot convert parameter 1 from 'stock' to 'void *' but i cant seem to find why ive read about realloc() but i know i need to use malloc() first or calloc() i just cant...
i nkow i have to malloc first
ok so ive done strcpy(). Its just the other error i cant seem to do with the relloc
heres the whole code:
#include<stdio.h>#include<string.h>
#include <stdlib.h>
ok so i have an error now which i dont understand could anyone shed any light please
1>e:\stock control master\stock control master\stock.cpp(109) : error C2664: 'realloc' : cannot convert parameter...
Thanks Malcolm. That is very helpful I had aalready attempted what you posted but I had a few errors but I can see where I had gone wrong much appreciated
Thanks
ok so heres my snippet of code what i want to know is how i could get the prgram to show the whole array of the text file as data gets added to the file
printf("Lists stock\n");
{
FILE...
Hi i have been able to write to a file but when i choose case 3 to read it just goes to write_info instead of read_infor all help would be appreciated thanks
#include<stdio.h>...
Ok I can write to a file and read from it but I don't know how to search for a piece of data write it into a temp file for editing then write it back into a the original file. Thabks
ok so ive changed gets to fgets but i dont have any idea how to edit the data in a file ive gone through books after books and websites just dont see to find it anyway .
#include<stdio.h>...
I have designed a stock system i can read and write to it but i dont know how to edit the data and create a stock level. The code i have is:
#include<stdio.h>#include<stdlib.h>...