within the getstring function, when i included the sizeof(); function into fgets, like this:
fgets(str,sizeof(str),stdin);
i obtained undesirable results.
when i sent the size of the...
Type: Posts; User: Shinzu911
within the getstring function, when i included the sizeof(); function into fgets, like this:
fgets(str,sizeof(str),stdin);
i obtained undesirable results.
when i sent the size of the...
what ??? I'm sorry for that I'll repost it when I get home
The program doesn't allow me to enter a name into the variable "name2"
#include struct{ char name1[256]; int age; char name2[256]; }test;int main (void){ char...
i created my own because trying to input data into a structure using fgets was problematic
my getstring function is messing up if it's used after the program accepts an integer value
the program does this :
enter name 1 : mike
enter name 2 : john
enter age 1 :...
@grumpy
i have tested it properly, the reason as to why one works and the other doesn't? is beyond my knowledge, that's why in here now
@whiteflags
please explain further - you lost me because i thought my "selection sort" function allows the binary search to work,and the "search" doesn't always return -1 it returns the position...
my test condition in the "ADD MENU" function
if( (pos = search(ID) ) == -1)
isn't working, thus two profile with the same ID can be added(which im trying to prevent)
I dont understand...
just when i was conformable whit pointers i saw this ,
Why does the function have an * in front it's name
char *my_strcpy(char *destination , char *source)
i thought it was a function...
ohhhhh i see thanks
it works when i used x like this
for(z_count=1; z_count<=nwords[x-1]; z_count++)
but now i don't understand why it works with x-1 and not y_count because there the same in value
i'm trying to output a number of "*" for the number it corresponds to in an array e.g
array[3]={1,2,3};
output:
1 |*
2 |**
3 |***
ii'm getting a weird output 'm not sure but i think the...
i'm ok with arrays it was the part above which u answered i didn't understand thank you that helps allot
can someone please explain this to me ?
if (c >= '0' && c <= '9')
++ndigit[c-'0']; // this line > what is it and what does it do?
taken from K&R:
#include <stdio.h>
haha thank u
compiler says "invalid lvalue in assignment"
if(c == ' ' || c == '\n' || c = '\t')
i don't understand why ,
any help is appreciated thank u
The program is intended to count the number of characters, words and lines entered. the program runs fine if only one line of text is entered, but if more that one line of text is entered the "number...
hello, i'm having a bit of trouble with escape sequences
A) \v - gives a vertical tab my text says
printf("\vthis is a text");
it doesn't print out vertical i get some weird symbol an...
i was reading a text which stated an integer array for e.g
int array[5];
can store 5 elements where ,as character array
char array[5]={"abcd"}
thank you :)
hello everyone,
i executed this code but the loop never ends because i have no idea what EOF is hence the number of lines that i enter is not printed.
What do i press to signal EOF when i'm finish...
question A: in the while loop we have,"*pB++ = *pA++; " to copy the contents of strB to strB, why is the entire string copied because *ptrA++ insures that it starts from the second character in the...
i edited my program using the fgets function, and read about it on how to remove the new line character , but since my program deals with and array of structures i'm really confused as to how i go...
Thanks for the link btw, very helpful
well what can i use instead ? all i know at present is scanf and gets