Another weird thing. Why is J's value 1 instead of 0 here??
(gdb) b main
Breakpoint 1 at 0x100000ad4: file month_reminder.c, line 11.
(gdb) r
Starting program: /Users/javaxtra/Desktop/MY/c...
Type: Posts; User: convenientstore
Another weird thing. Why is J's value 1 instead of 0 here??
(gdb) b main
Breakpoint 1 at 0x100000ad4: file month_reminder.c, line 11.
(gdb) r
Starting program: /Users/javaxtra/Desktop/MY/c...
Thank you again for all kind response.
My question is, yes I see that i is being incremented and points to last point position when it reads all input, so at the end, it's pointing to last position...
Just one more question, I am failing to see where the value 'i' (for which is being return) is being used for.. ?
int read_line(char str[], int n )
{
char ch;
int i = 0;
...
@anduril462,
Thank you for your explanation. Very detailed. I understood perfectly.
Here's the code I am studying from "modern day c programming"
#include <string.h>
#define MAX_REMIND 50
#define MSG_LEN 60
int read_line(char str[], int n);
just in case any other newbie like me wanted to see the steps
#include <stdio.h>
#define TRUE 1
#define FALSE 0
typedef int Bool;
You are right.
thank you!!
Enter a number: 123
digit is 3
n is 123
n is 12 after division
digit is 2
n is 12
Hi, I am testing a below from book " C : a modern approach"..
I don't understand why this program is not working ... when i put 123, it digit_seen should still be false(intialized all w/ 0).. but...
Hi, thanks for replying on this issue.
I guess I have a problem understanding the syntax of it.
Wouldn't Ethernet_Frame pointer be --> *Ethernet_Frame ?
but instead, I have Ethernet_Frame* ...
ethdr = (ETHERNET_FRAME*)&tmp[0];
I thought pointer (whether declearing or referencing it), * should be on left side of the word.
One of the code I was studying, I saw code like above where *...
that's what i don't understand.
I have gone through other included headers and did not see the __THROW defined anywhere.
#ifndef _SYS_IOCTL_H
#define _SYS_IOCTL_H 1
extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
how does one read above?
I was thinking global int type function name ioctl has these (....).. but what is
__THROW...
can someone provide me w/ great tutorial or link that explains the relationship between multi dimensional array and pointer?
I can see that char reminders[MSG_LEN+3] is one string vs char...
thanks guys,
I certainly now understand what those loops are doing.
one more thing however, I really don't understand why it was necessary for multi dimensional array to be need for
11 ...
thanks guys, I am gonna digest this bit and try few more things and get back to you guys..
thank you once again!!
Hello everybody,
I have been reading C programming "a modern approach" and I must say this has been my best c book(I am a very very newbie)..
Anyway, below example from that book has me bit lost...
thank you!!!!
my gosh, yes thank you so much.
(int)(cp-in_line));
I just have one more question..
why was there a need to subtract in_line from cp ?
Hi, here it is.
root@userA-laptop:/sc/c# cat cha_handle.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LINELNG 100 /* max length of input line */
that didn't work..
anything else?
Hello, I am just going over tutorial on line and working on this character handling program from on line tutorial.
First of all, I just copy the program but it doesn't compile.
It complains that...
so far this is working fine for me..
#include <stdio.h>
#include <string.h>
main( int argc, char *argv[] )
{
//char filename[29];
my bad,
of course only below code would product 5.. I am still trying to see what everyone was talking about earlier.. will get back to you. thanks
#include <stdio.h>
main()
{
sorry, Quzah, but I just tried your code and it actually printed 5.. ?
[root@Xclient c]# cat variable_print.c
#include <stdio.h>
main()
{
int x = 5;
cyberfish, I certainly understand and appreciate your concern.
Sometimes, I don't understand such simple as
system("command", "arg1", "arg2"); where arg1 or arg2 can be variables..
in perl...