1,088 Posted Topics

Member Avatar for RenFromPenn

>What am I missing? How do I get the first number to display? Move [ICODE]#define NUMBERS 7[/ICODE] outside of main so the function print can see it. In print() remove [ICODE]i= *nums++[/ICODE] which is doing harm and producing nothing since you change the value of i inside the loop to …

Member Avatar for RenFromPenn
0
114
Member Avatar for kikloo

You use the standard C functions [URL="http://www.cplusplus.com/reference/clibrary/cstring/strcat.html"]strcat()[/URL]

Member Avatar for Murtan
0
269
Member Avatar for Excess3

[ICODE]temp[strlen(temp)-1]='\0';[/ICODE] assumes that there's always a '\n' at the end of line, and that could be not the case. [CODE=C] /* wanted MAX_LEN of data, is there something to read? */ if (fgets(temp, MAX_LEN, input) != NULL) { size_t net_len = strlen(temp) -1; /* trim the newline/return if it's there …

Member Avatar for Excess3
0
123
Member Avatar for dc87

[QUOTE=vikas1;765766]the following written attachment can be your answer....[/QUOTE] Make a habit of noticing the date when the post was written, and then make a judgment if your comment is going to be of some value, based on the time passed.

Member Avatar for Aia
0
343
Member Avatar for kacete

Since you don't check the return of fgets() for success, sscanf() is at the mercy of whatever got assigned into the variable [I]stemperature[/I] As a test, include [ICODE]printf("Show me what's in stemperature >>%s<<\n", stemperature);[/ICODE] after [ICODE]fgets(stemperature, 4, pf1);[/ICODE] to show you what I mean. It is always a necessary practice …

Member Avatar for kacete
0
190
Member Avatar for vaibhour

[QUOTE=Narue;577308]>eek Yea, that's why everyone keeps saying I've mellowed out. ;)[/QUOTE] Silly people, don't they know volcanoes. At anytime they can erupt again. It is in their nature.

Member Avatar for vikas1
0
117
Member Avatar for Clockowl

[QUOTE=Clockowl;764961][...]I disagree with this: "The string is a constant, so calling strlen() every time is only going to waste time, because it always returns the same result." I'm expecting my compiler will do that for me, it seems like a very simple optimization to make, right? The rest is right …

Member Avatar for Salem
0
113
Member Avatar for serkan sendur

About [URL="http://puppylinux.org/wiki/how-tos/general/filetypeassociation"]File Type Association[/URL] in Linux A more [URL="http://groups.google.com/group/alt.os.linux/browse_frm/thread/606cd73e9b8e8815/e81cd868ffc2b50b?lnk=gst&q=file+association+in+linux&utoken=dTQB0C8AAAAiXwthDVv3-0EgBRvjJ00A8OBQgCxQ0ScvHI3DrmakHRGZ_JFPllpHm_8hELQTsBc"]serious conversation[/URL] at alt.os.linux google groups

Member Avatar for eggi
0
303
Member Avatar for m24r

[ICODE]char *glblclrtab;[/ICODE] by itself will not allocate any memory to be use. [B]malloc()[/B] must be invoked to set apart as much memory as needed to hold the data you intend to assigned (point) to it.

Member Avatar for death_oclock
0
168
Member Avatar for jagr200

>creates the file or directory A menu to choose what to create could be an option in this situation. Read here [URL="http://www.tldp.org/LDP/abs/html/testbranch.html"]how to create menu[/URL] Meanwhile if a loop will do you need to think how to exit the loop. Something like... [CODE=bash]until [ "1" = "0" ]; do #forever …

Member Avatar for Fest3er
0
96
Member Avatar for suley04

The errors come from using the fwrite() function in an incorrect way. Here's an usage [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fwrite.html"]example[/URL] Pay attention to its prototype.

Member Avatar for ajay.krish123
0
728
Member Avatar for Creator07

[QUOTE=Creator07;762874] Hello, I tried it as you said, but its still not working. [/QUOTE] Show us the code. [QUOTE=Creator07;762874]Incidentally, its taking the value of Designation but no name!!!! and added to that, fgets is also putting 2 '/n' after I complete the input... May be that which I input(by pressing …

Member Avatar for Creator07
0
185
Member Avatar for mayo_tech11

[quote=joshSCH;393520]Indeed. Rashakil is sure to sweep this thread and give us all bad rep lol.. [/quote] If you keep posting his handler name you surely are going to wear it out. May be he needs to ask you for royalties for using his alias so many times.

Member Avatar for techbound
0
2K
Member Avatar for mini programmer

strtok() will try to find whichever characters you'll pass it as the second parameter. If you give it a '/', it will return a pointer to the first time it encounters that character. Enclose it into a proper designed loop and you can use it to chop the given array …

Member Avatar for mini programmer
0
151
Member Avatar for Pender

[QUOTE=Pender;755693][...] i need now a command (e.g. awk or sed) which deletes the whole line containing the name, plus next line. but it must be exact match, deleting "test " must not end up in deleting all lines including "test" like "testt" or "testtt" [/QUOTE] [QUOTE=Pender;755710]i have no clue how …

Member Avatar for eggi
0
163
Member Avatar for leegeorg07
Member Avatar for LightSystem

[QUOTE=LightSystem;594286]Ive just found out that in line 78: fgets(aluno, 20, stdin); If I replace 20 with 4, I dont get the error I described above when inserting 1000. Why is that??[/QUOTE] Changing the range of characters that fgets can read to four will only put 100 + \0 into the …

Member Avatar for dreaddoC
0
91
Member Avatar for LightSystem

[ICODE]for(i=10;i<50;i++)[/ICODE] This will display every character starting at seq[10] and will stop at seq[49]. Is the array that you passed as an argument in justapoe() that long? like char seq[50]. Has it been initialized with some value already? Before passing it to the function?, if not, guess what? It contains …

Member Avatar for jephthah
0
92
Member Avatar for sambafriends

You're living in the fast lane. Before you can understand structures and pointers in C you should have learned that main is defined as: [ICODE]int main(void) [/ICODE]or [ICODE]int main(int argc, char *arg[])[/ICODE] and in both cases it needs to return an int.

Member Avatar for sambafriends
0
277
Member Avatar for Lardmeister

Darn it, I didn't know we were having fun with our favorite cartoon characters over here. Let me participate and contribute this [URL="http://wizbangblog.com/content/2008/09/19/what-happened-when-obamas-teleprompter-broke.php"]piece[/URL] destine to become a classic.

Member Avatar for jbennet
0
3K
Member Avatar for The Dude

[QUOTE=The Dude;709937][url]http://www.doncastertoday.co.uk/ViewArticle2.aspx?SectionID=786&ArticleID=1052313[/url] I dont think its a good idea........ They cant tell whats OK and what isnt most of the time and if they start playing with a TOY GUN,they might think a real gun is the same!![/QUOTE] Should we allow children play with cars? They smash them one against …

Member Avatar for hughv
0
277
Member Avatar for The Dude

[QUOTE]Listen mate - you're definitely not British. Or Australian. Or Canadian even. British culture is simply not your cup of tea. And you're obviously off your trolley! If it just so happens that you live or come from Great Britain, you're still not British. There's not really anything British about …

Member Avatar for Obeledeveloper
0
139
Member Avatar for OreWaChoOtakuDa

[quote=christina>you;398406]Is this girl interested in you?[/quote] No. In his car. You have a car, I presume?. No?!. Fat chance!.

Member Avatar for Kokimail
0
1K
Member Avatar for Ancient Dragon
Member Avatar for atman

[CODE=c]int n = 444; printf("%09d", n);[/CODE] More examples [URL="http://www.daniweb.com/forums/post399355-3.html"]here[/URL].

Member Avatar for yuvaraj.tr
0
99
Member Avatar for begyu

[ICODE]sed '1 i\ ' [/ICODE] will add an empty line above the first line (that's a [B]one[/B] and not a low [B]L[/B], there's a space between [B]\ [/B]and last [B]'[/B]) [ICODE]sed 's/^$/2/'[/ICODE] will substitute any empty lines for a 2

Member Avatar for chris5126
0
101
Member Avatar for sneekula

[QUOTE=Serunson;711789]The previous prime minister was Tony Blair, also an idiot, and the current one is Gordon Brown, a very big idiot. Basically the entire Labour party are out to make our lives a living fortress of DOOM, by taxing us, and making us a nany state, where we cant do …

Member Avatar for lllllIllIlllI
0
330
Member Avatar for atman

First you need to use a function for reading input, that will not stab you on the back as scanf() does. ;) Take a look at fgets() and how it works. With it you can always limit the amount of input it will read from stdin, and you'll be always …

Member Avatar for devnar
0
99
Member Avatar for lllllIllIlllI

[QUOTE=paulthom12345;726307][...] So maybe squaring the dollar would make it... more valuable? [...] [/QUOTE] I thought that was called "stretching a buck" ;) However, I tried to square it, and now is worth...well, you see. :'(

Member Avatar for lllllIllIlllI
0
158
Member Avatar for christina>you

[QUOTE=sneekula;726599]Absolutely fantastic smear! Now I know why most people will vote for Senator Obama.[/QUOTE] You don't know jack.

Member Avatar for christina>you
0
174
Member Avatar for atman

Before [ICODE]average=total/i;[/ICODE] just add [ICODE]printf("Tell me what's in i: %d\n", i);[/ICODE] and perhaps you'll find out the problem.

Member Avatar for Aia
0
145
Member Avatar for BestJewSinceJC
Member Avatar for Superstar288

>so i just want learn what i am doing wrong for future reference. The first thing would be compiling a C++ program [ICODE]portfolio2.cpp[/ICODE] C code doesn't end in .cpp, they end in .c

Member Avatar for Superstar288
0
117
Member Avatar for IrishUpstart

>Also, for N, I want to start at 25 and bump it up by 25 through each loop... If I understand correctly. [CODE]for (i = [COLOR="Red"]25[/COLOR] ; i < N ; [COLOR="Red"]i += 25[/COLOR] )[/CODE] You are not returning the final result of sum.

Member Avatar for devnar
0
106
Member Avatar for slimjimmer

That particular one is a simple coma been missing. [ICODE]sscanf (argv[1][COLOR="Red"], [/COLOR]"%d %d %d", &a, &b, &c);[/ICODE] Did you forget to return in main? [Edit:] By the way argv[1] should be replaced by another variable place holder if you intend to ask the user for some input and after you …

Member Avatar for slimjimmer
0
435
Member Avatar for sharpst

> i think it would really help u.. No it won't. >i have got the program for the calculator using graphics . Why did you not just paste the [URL="http://www.cetpainfotech.com/c%20projects/calculater.c.txt"]link[/URL] where you got it? The least you could have done it is to use [URL="http://www.daniweb.com/forums/post452439.html#post452439"]proper code tagging[/URL].

Member Avatar for ajay.krish123
0
786
Member Avatar for atman

>which CODE tags should i use? [URL="http://www.daniweb.com/forums/thread93280.html"]Click here.[/URL]

Member Avatar for Aia
0
170
Member Avatar for thanatosys

[QUOTE=ddanbe;723446]Test for an end of file condition. Use something like [B]while(!feof(inputfile)) [/B][/QUOTE] Bad idea, feof() shouldn't be use as the exit control of a loop. [URL="http://www.gidnetwork.com/b-58.html"]Read on[/URL].

Member Avatar for Aia
0
290
Member Avatar for atman

[QUOTE=yuvaraj.tr;725266]int sec_code; printf("enter the sec_code"); scanf("%d",&sec_code); while(sec_ocde < 0 && sec_code > 4 ) { printf("invalid Sec_code \n please enter between 1 to 4 "); }[/QUOTE] That it is a nonsensical condition. When would that condition meet? Nonetheless, it is a good thing that it doesn't, because it would enter …

Member Avatar for Aia
0
237
Member Avatar for yinfu89

>I will add comments shortly to explain how this works. You should seriously consider learning how to do it on your own, otherwise, you will not pass your class. How come? When all [s]he needs to do is copy and paste. >This is the correct code. No it is not. …

Member Avatar for ddanbe
0
133
Member Avatar for jbennet

[QUOTE=sneekula;720693]I am not from Scotland, but would love to be! [/QUOTE] Just imagining.

Member Avatar for sneekula
0
149
Member Avatar for Aia

That word got stuck in my ears as I forced myself to watch to the end. Why do we even have to question such unspeakable actions against the innocent and defenseless? You tell me what kind of creature are we by standing without doing anything about it. [url]http://www.youtube.com/watch?v=foSW-CkWbqI[/url] To which …

Member Avatar for Lardmeister
0
368
Member Avatar for ROTC89

Let's work with what you have. [CODE]counter initialized to zero while counter less or equal to nine; do row initialized to zero while row is less or equal to counter; do echo -n row #-n suppress echo from adding a newline increment row by one done echo increment counter by …

Member Avatar for eggi
0
274
Member Avatar for kidd218

>the question: [URL="http://www.daniweb.com/forums/announcement118-2.html"]The answer[/URL].

Member Avatar for Aia
0
125
Member Avatar for naeem1986

I don't have any intention of debugging your whole code, but... [CODE]lop1 = 0; while (read(fd, &rdr, 1) == 1) { [COLOR="Red"]fstrg[lop1] = rdr;[/COLOR] if (rdr == '\n' || rdr == EOF) break; } [/CODE] fstrg[[COLOR="Red"]lop1[/COLOR]] is always fstrg[[COLOR="Red"]0[/COLOR]]

Member Avatar for naeem1986
0
128
Member Avatar for akbar002426

>i am really in trouble with this issue? Yes you are. Definitely, over your head if you can't [URL="http://www.daniweb.com/forums/announcement118-2.html"]read[/URL].

Member Avatar for thanatosys
0
113
Member Avatar for thanatosys

[CODE]typedef struct node { char value; bool isroot; bool isend; struct node* sibling; struct node* child; }[COLOR="Red"];[/COLOR] [/CODE] He meant there.

Member Avatar for thanatosys
0
265
Member Avatar for jianna
Member Avatar for jianna
0
461
Member Avatar for blackslither

Further [URL="http://www.augustcouncil.com/~tgibson/tutorial/ptr.html"]understanding[/URL].

Member Avatar for Aia
0
147
Member Avatar for Barefootsanders

>However, I've realized this does not work because of the way arrays are addressed. Nothing to do with it. Your error is in the subscripts. [CODE]array[2] = array[1]; array[[COLOR="Red"]1[/COLOR]] = array[[COLOR="Red"]0[/COLOR]]; array[[COLOR="Red"]0[/COLOR]] = result;[/CODE]

Member Avatar for ddanbe
0
115

The End.