Well, i believe i should check if head is pointing at something (because it doesn't then there's no list and rest of the code in function search makes no sense). Thanks for help, i really should...
Type: Posts; User: cdummie
Well, i believe i should check if head is pointing at something (because it doesn't then there's no list and rest of the code in function search makes no sense). Thanks for help, i really should...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct item
{
int code;
char name[21];
double amount, price;
}ITEM;
I think i see it now, it means it points at nothing, the fact that the pointer is NODE only means it points to a variable whose type is NODE.
Say i have a structure like this:
typedef struct node { int number;
struct node *next;
}NODE;
int main ()
Well, i have to admit that you are absolutely right, but the problem is that i always first try to make my program work, and somehow i put aside things like making code readable and stuff. By the...
I did it with strstr but it makes no difference. Program acts same way it did before.
I have to make a code that whenever it finds a string in a file that is same as the string which is given as the second command line argument it switches it with string that is third command line...
You are right, i will keep that in mind for the next time. :biggrin:
It's first letter of the word that means length, i guess i should use three letters just like i did for "cit".
Thanks a lot for helping me understand this, im not really familiar with pointers (especially with "double pointers"), basically i compared a value of s[i] with the memory location of command line...
Well, i didn't considered it as error since it appears just as a warning, i saw it, but i couldn't figure out what's the problem since both s[i] and argv[2] are chars, i don't know how one of them...
I have to make a program that takes the file that is firs command line argument and whenever it finds a char in that file that is same as the second command line argument it switches it with char...
It actually works when i add space before %c, it works even if i put %s instead of %c, but why do i have to add space before, is there something i don't know about it i mean why space before %c makes...
It's not problem with the output, it asks me to insert s[1]=s[2]= and the without asking for s[3]= (even though it prints it on the screen) it just prints whatever i inserted when it asked for...
I've added & before s[i], and still, same thing happens.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,i;
char s[100];
printf("n=");
scanf("%d", &n);
How fscanf function works, i mean does it read whole content of a file or it reads one string at the time.
I didn't noticed that, i guess i should check code better before posting again, anyway, thank you.
#include <stdio.h>
#define MAX 100
void formiraj (double [],double [], int, double (*p)(double));
double razdvoji (double);
int main()
{
double a[MAX], b[MAX];
int n,i;
I'm not really familiar with using debugger, but thanks anyway.
I didn't wrote it myself, that's why i don't understand what's going on, i believe you are right about code being complicated, but still, i need to understand what is happening, then i'll be able to...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
char * form(char *format, ...);
int main()
{
char *s;
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdarg.h>
char * konkatenacija(int n, ...);
Thanks, that really helped me.
What would happen if, for some reason, i must free the string that is not allocated, but it has a value 0, like char *string1 = 0, can i use free(string1)? And why?