Thanx guys ;)
Type: Posts; User: Karpaty
Thanx guys ;)
I have a question about linked lists. I have this code below, which Im trying
to familirize myself with by carefully breaking down each statement...
But im having trouble with one line (see...
Well, we've been told that for the exams we wont be allowed to use any library fuctions apart from those in stdio.h
A problem: if i change str2 to "s " (s followed by a space character) I get a NOT FOUND outcome...
Ok, I've rewritten the program... Seems to be working well... Although my function is much longer than 5 lines long... Is there an easier way of doing the same thing with less code?
#include...
No, Im not allowed to use any string.h functions
Thats what Im actually trying to do with the code inside main(). Sure, its not a function, but the purpose remains the same...
Hi, im trying to write a code to find whether one string is inside another string, without using the strstr() library. What I got so far is as follows:
#include <stdio.h>
int getlength(char[]);...
Ok, thank you... I got it working... :)
Hi, im stuck with this part of the program where I have to read all the data from a file (structure by structure) and display it in the list. The way I approched this is by first finding the total...
I finally got it working... It was quite simple actually...
The way I got it to work is, as suggest by Elysia, by reading the previous data for the product into the structure and only then changing...
If this has been discussed before, can you please point me to where I can read about it... I searched this forum for hours and couldnt find much help. perhaps i was searching for the wrong keywords?
Its Windows... thank you :)
Im still unable to make this program work...
Ok, here's what I did:
In the menu I gave the user a choice to add new product, modify the name of a specific product or exit. In the structure i...
Cheers... I've been struggling with this problem all weekend... Will now try and put the theory in practice ;)
Oh, thanks for clearing that up...
btw, Elysia, I have this function to add a new product:
void add_product(product *p) {
printf("Enter product description : ");
gets(p->name);...
Sorry, i shoudl've been clearer... If I had written the structure into a file and then wanted to access only the price (to edit it for example)... Would I use something of this sort?
...
hehe, i just came here to ask absolutely the same question...
I have a structure (a string of 50 bytes, a double of 4 bytes and an int of 4 bytes)...
typedef struct product {
char name[50];...
Doesnt "rb+" open the file for reading/writing?
I tried to change it to just "w" (to write into test2.txt), but it didnt work...
Ok, i rewritten the program with structures (included changes you suggested, apart from fgets(). when i use it the code doesnt compile)... Here's the updated code:
#include <stdio.h>
struct...
Im writing a simple program that will ask user to enter his name and age,
store it in a file and then display it from the file... Here's what i got so far....
Edited: see code below....
I dont...
Thanx. Will check it out ;)
Hi, sorry if this isnt related to any coding...
Im just looking for a program (preferably a freeware) that would act as an editor and would also provide compile and run features. At the moment im...
Hehe, you noticed that didnt you? Yeah, we only did gets() at this point, so I was quite reluctant to jump ahead of myself, even though everyone around said fgets() is better.
Thank you as always......
Actually we did do the dynamic allocation of memory (malloc, calloc etc) last week, but we were told it was not essential for this particular assignment.
Im gonna try to do it anyway, since it seems...
I think I can fix this problem by including the...
getchar();
...line after the previous scanf() statement (see the edited code in the previous post)...
Hmm, when you put it this way,...