Hi, I was just passing by and was looking at the above section of code. Was wondering if you last line of code for returning the value of string compare works. Maybe you should try,
...
Type: Posts; User: learninC
Hi, I was just passing by and was looking at the above section of code. Was wondering if you last line of code for returning the value of string compare works. Maybe you should try,
...
void InsertCharacter(Head *head, char *_char)
{
String *current;
/* some function */
/* I try to copy a character by character into the list */
while ((_char = getchar()) != '\0')
{
Thx hk_mp5kpdw! I tried assigning another char pointer to temp, and took into account of the NULL character, now it works perfectly. Thx again!
Thx Bella_Rosa for the reply, will try your method...
Hi all, I was just playing around with strings, and I tried doing a string reverse using pointers, however, it did not turn out as I wanted. I tried using arrays and it works, but I cant do the same...
Ok, I got it, thanks guys!
Hi all, can anybody help me solve the problem below? If I enter a string with a string length of more than 10 for inputString, the next fgets will just take what is stored in the buffer. I searched...
Sorry I am still a bit confused. Please bear with me, as I'm quite new to structures and dates. Given the following structure:
#include <time.h>
struct sb
{
int id;
struct tm date;...
I would like to ask if it so happens that the structure contains a date. How do you strtok it? For example:
#include <time.h>
struct sb
{
int id;
struct tm date;
int count;
char...
To eliminate the problem, either u use function prototypes declaration, or you arrange your function wall_collision before the function movement, as function should be declared before they are used. ...
Oh thanks! Sorry for not reading the FAQs. Will keep that in mind in the future.
Hi all, I'm still new to C and would like to ask the following questions. When I use fgets(), does it also reads the '\n' character? What should I do if I would like to print in the following manner....
BookListType* bookList = NULL;
BookType* example = malloc(sizeof(BookType));
bookList->head = example;
bookList->head->id = 5;
I have read throught link list, but I was wondering how can one...
Cool! hk_mp5kpdw thank you so much. I have gain more knowledge on C programming now =). Silly me, din use the strcpy function
oh thanks!!! Quantum1024, your hint has just woke me up. I've managed to solved the problem by initialising store. Thanks for all yr help guys, and thanks InvariantLoop
Thx Quantum1024. I was also thinking about the same problem, but how do i initialise it? Cos I want to start of with an empty array.
Its not a complete program, you have to include the header files, <stdio.h>, <ctype.h> and <string.h>. Also convertString is function i wrote, but it doesnt not have any effect on the main code, so I...
Hi all! What i'm trying to do is to store the longest string being input into the program and print it out later. However when i print the longest string, it has some wierd characters at the back....
Thanks a lot Quantum1024! It works perfectly. Could I know why the alogorithm is done in that manner? I'm a bit confused about having a do while loop there. Thanks a lot cos I wanna learn more. =)
Yeap thx! I know that i need to check for more than 1 space in a row, but how do I implement it? I've been trying, but seem not to be able to code it without getting any errors.
Hi all, I'm quite new to C programming, so forgive me if I've made silly mistakes. I'm tryin to write a program to remove the extra spaces between words.
For example:
Input: C Programming ...