1,088 Posted Topics

Member Avatar for The Dude

daniweb is like a normal mattress, but it can easily be recycled. Let's interpret that in a positive way: [B]daniweb is like a normal mattress[/B]; mattress invite comfort; rest of the labor of the day. [B]but it can easily be recycled[/B]; Heck yes, you just have to press Reload current …

Member Avatar for maui_mallard
0
245
Member Avatar for nikita_knp

[QUOTE=nikita_knp;542733]can anyone plz help me out..to make a text editor in C... i dun even know where to start with... [/QUOTE] Make sure you implement a spell checker. It appears you can make use of it. You need to post your code in order for us to get an idea …

Member Avatar for rizwan_aman007
0
160
Member Avatar for joshmo

[CODE][COLOR="Red"]char path[/COLOR],argum; [COLOR="Green"]/* path needs to be a string or array of chars */[/COLOR] printf ("Enter the path name "); scanf ("%[COLOR="Red"]c[/COLOR]", &path); [COLOR="Green"]/* It's getting only one character it needs to read a string */[/COLOR] [/CODE]

Member Avatar for joshmo
0
108
Member Avatar for plgriffith

A segmentation fault occurs when a program tries to access memory location that is not allow to play with. My guess is that your char* is pointing to some wrong memory location. Maybe you haven't initialized to point to a string.

Member Avatar for plgriffith
0
2K
Member Avatar for mayank24

[QUOTE=mayank24;544467] Can anybody tell me what condition I have to use here?[/QUOTE] I see the possibility of an switch inside a do/while loop [CODE]declare an input variable and a flag variable set a flag to false ask the question do obtain the user input switch input variable wrong input: display …

Member Avatar for mayank24
0
67
Member Avatar for 88omar

[QUOTE=Google Spider;543440]maybe some misunderstanding on your part ?[/QUOTE] Nope, this thread got moved from C++ forum to C

Member Avatar for Google Spider
0
200
Member Avatar for zandiago

[QUOTE=joshSCH;519382]I don't have anything to hide..[/QUOTE] It is that kind of mentality what makes us "sheep" ready for the butchery. I do have things to hide. That's why I wear clothing. What if I want to hide pictures of my family? Bank statements? An important project that I want to …

Member Avatar for jbennet
0
640
Member Avatar for RexxX

[QUOTE=RexxX;542427] *edit - So do I just need to allocate a memory location to newNode? If so how?[/QUOTE] Using malloc defined in stdlib.h [CODE]*newNode = malloc ( sizeof ( struct node ) );[/CODE] Any dynamic memory you allocate, it needs to be freed at some point, when you're done; using …

Member Avatar for Aia
0
104
Member Avatar for kwadders

Go here and download [URL="http://www.mindviewinc.com/ThinkingInC/Beta3Download.php"]Thinking in C[/URL] by Bruce Eckel. These are a sequence of flash tutorials. Lesson 2 is all about data types and their limits. At the end of that lesson there's an exercise example of how to round up a float to the nearest whole.

Member Avatar for Aia
0
75
Member Avatar for hallinan

>sort_date(struct_acc Acc[], int n);//Here Is Where the error is?? That should be a function call, however you are making it like if it were a prototype of the function sort_date.

Member Avatar for hallinan
0
92
Member Avatar for zandiago

It is as futile to measure [B]Life[/B] by the stick of fairness as it is to measure [B]Ligh[/B]t in liters.

Member Avatar for briansmall
0
396
Member Avatar for AMARJEET DUA

Glad you found a possible solution. If you're going to stick around could you do us a favor? Could you stop Capitalizing at random some ( most ) of the words? It makes your post hard to read. And we could live without the ..................... as well, it doesn't do …

Member Avatar for Narue
0
147
Member Avatar for RexxX

>I'm learning how to use fgetc properly fgetc reads a character from the stream passed and return that character. The catch is that character needs an int, so fchar needs to be of type int. ...but that's not your problem. [CODE]printf("The first char is %s\n", fchar); //print a character[/CODE] print …

Member Avatar for Aia
0
221
Member Avatar for csteverun

Very eloquent title for your post. You are looking at the wrong variable. You are paying attention to qevent when you should pay attention at rendering = 1; From here what I see is that when the [B]if (qevent > 0)[/B] gets executed, it sets [B]rendering = 1;[/B] and according …

Member Avatar for csteverun
0
176
Member Avatar for gallantmon1

Perhaps a little more practice is required with easier concepts, before attending such modifications? Went through the first function step by step. Look at the logic written in comments. [CODE=c] char nocomment() /* void nocomment() since there's no return by this function */ { FILE *src, *noc; /* two pointers …

Member Avatar for Aia
0
119
Member Avatar for T-Mac1

salary and rate needs to be floats not ints To display only two digits in the decimal section: [CODE]printf( "%.2f\n", salary );[/CODE]

Member Avatar for Aia
0
136
Member Avatar for sachinvador

You can parse the string looking for spaces using the function [URL="http://www.cplusplus.com/reference/clibrary/cstring/strtok.html"]strtok[/URL]. Or you can do it in [URL="http://www.daniweb.com/code/snippet318.html"]this way[/URL]

Member Avatar for Aia
0
120
Member Avatar for RexxX

char *pstr = [COLOR="Red"]finlename[/COLOR]; misspelling of filename scanf("Enter the filename: %s", [COLOR="Red"]&[/COLOR]filename); remove the & at filename printf("The name of the file is %s", [COLOR="Red"]&[/COLOR]pstr); remove the & at pstr [COLOR="Red"]function[/COLOR](pstr); wrong function, it should be called func

Member Avatar for Aia
0
112
Member Avatar for neclark2

write getchar(); before return. That should pause until you press enter if no characters was left behind in the stdin. If you can change compiler. Miracle C is broken. Look[URL="http://www.daniweb.com/forums/post234971-1.html"] here [/URL]for some suggestions

Member Avatar for DangerDev
0
117
Member Avatar for neclark2

argv[1] is a string even if you enter a character. Find the length of the string and use a loop to go through each character. [CODE]printf( "%d\n", argv[1][i] );[/CODE] [Edit] That example will display the first character of the string. [B]printf( "%d\n", (int) argv[1] );[/B] is displaying the possible interpretation …

Member Avatar for Aia
0
77
Member Avatar for jaggesh

[B]Did[/B] you wonder how come Ancient Dragon's code post looks so nice and your post is all scattered over, and hard to read? Please [URL="http://www.daniweb.com/forums/post452439-1.html"]read[/URL].

Member Avatar for Aia
0
103
Member Avatar for hallinan

*cus[max]; This declares 100 pointers of type customer, but you haven't point them to any memory, therefore you cannot use them in the fscanf() call. Malloc can set apart memory of type structure customer and you can access it via cus pointers.

Member Avatar for Aia
0
162
Member Avatar for wolverine_ramir

[QUOTE=jephthah;533371] now tell me, do you always engage in such tendentious pedantry on trivial matters, or do you reserve this unappealing behavior only for the new people? [/QUOTE] Are you saying you never read the fraternity initiation test post? So far the judges are not impressed. You better be ready …

Member Avatar for John A
0
152
Member Avatar for RexxX

void fileReader(infile[] ); like void fileReader( char *infile ) ??? [B][Edit][/B] That's the prototype of a function that accepts a string as parameter fileReader( string ); is the actual call in main where string could be char string[] or char *ptr_to_string = string; or char *string = "literal string";

Member Avatar for Aia
0
76
Member Avatar for maui_mallard
Member Avatar for Anonymous86
0
150
Member Avatar for fskhan

[QUOTE=Duoas;530865] Before complaining too loudly you should have noticed that my algorithm and yours are nearly identical. [/QUOTE] Man, as soon as I saw that sentence of yours with "nearly identical" I thought. Poor guy. He's is leaving himself open for incoming cheap criticism.

Member Avatar for jephthah
0
3K
Member Avatar for wollacott

[QUOTE=wollacott;531124]i havent tried it yet caz i'm stuck here what shud i put after & so it can work? printf( "Enter product number \n"); scanf("%f",&); printf( "Enter quantity : \n" ); scanf("%f",&);[/QUOTE] [CODE]int product; scanf( "%d", &product ); int quantity; scanf( "%d", &quantity ); [/CODE]

Member Avatar for Aia
0
114
Member Avatar for hallinan

Stick with one forum. You are been helped over [URL="http://cboard.cprogramming.com/showthread.php?t=98476"]here[/URL].

Member Avatar for hallinan
0
535
Member Avatar for LisaLLL

[QUOTE=LisaLLL;519276]I am trying to edit a string in c. I need to remove the last 84 characters from a string[400], insert text and re-insert the 84 character string at the end. No problem adding text or coping text in C, but I can't remember how to reorder/manipulate the text string. …

Member Avatar for Agni
0
69
Member Avatar for HLA91

What part did you not understand of the answer over [URL="http://cboard.cprogramming.com/showthread.php?t=98355"]here[/URL]?

Member Avatar for Aia
0
283
Member Avatar for kxh29

A little snippet can be found [URL="http://www.daniweb.com/code/snippet719.html"]here[/URL]. For getting deeper in the bowels of MS Windows check this [URL="http://www.winprog.org/tutorial/start.html"]one[/URL]

Member Avatar for Aia
0
1K
Member Avatar for kamathmahendra

[CODE]scanf("%s", &name); [/CODE] scanf() is not a good choice to read a string. User fgets() instead. [CODE]FILE *file; file = fopen(name, "r");[/CODE] What happens if the file doesn't exist. Must check that the file can be opened. [B][I]exempli gratiā [/I][/B][CODE]if( file == NULL ) { < handle the error> }[/CODE] …

Member Avatar for Aia
0
220
Member Avatar for jan1024188

According to MS, [URL="http://msdn2.microsoft.com/en-us/library/ms645505.aspx"]hwnd[/URL] is a Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. This thread is getting a little old by now. You'll get better result if you post in a new thread …

Member Avatar for Aia
0
129
Member Avatar for gallantmon1

Go to statements go like this: [CODE=C]/* create the label */ ins: /* then call the goto */ goto ins;[/CODE] Substitute every [COLOR="Red"]goto <label>:[/COLOR] that you have for [COLOR="Green"]<label>:[/COLOR] or goto <label>[COLOR="Green"];[/COLOR] depending on if is a call or a label. [B]BTW.[/B] What a fine example of why [B]goto[/B] shouldn't …

Member Avatar for gallantmon1
0
542
Member Avatar for kv79

If you're creating a program that copies a file you need to look at these standard functions: fopen(), fclose(), fread() and fwrite().

Member Avatar for Ancient Dragon
0
86
Member Avatar for joomy
Re: tree

[B][I]I want to be handsome, rich and famous[/I][/B]. Unfortunately, none of the members in Daniweb seems to be able to help me. Still waiting, though. ;) Post the pertaining part of your code concerning to you request. Make a clear inquire about your problem. And perhaps, you'll be helped sooner …

Member Avatar for Narue
0
107
Member Avatar for sk8ndestroy14

We haven't learn how to count down regular natural numbers and you want us to follow this one. Ha!. We'll see. 3

Member Avatar for BearofNH
0
2K
Member Avatar for bobei89

[QUOTE=bobei89;515503]if(!(a%10)) but what is not (a%10)? [/QUOTE] [B]if( !( a % 10 ) )[/B] What's the programmer trying to achieve here? Is looking for when the result of the operation [B]a % 10[/B] would be [B]0[/B], however [B]0 [/B]inside an [B]if[/B] statement will never execute since in [I][B]C[/B][/I], [B]0[/B] is …

Member Avatar for bobei89
0
154
Member Avatar for stackOverflow

[QUOTE=stackOverflow;513650]I agree, but its unfortunate that few schools like ours still insist on "riding a horse". And i have no choice but do what i am supposed to ...[/QUOTE] [I][B]"Don't let school get in the way of your education." [/B][/I]~[B][URL="http://en.wikipedia.org/wiki/Mark_Twain"]Samuel Langhorne Clemens[/URL][/B]~ What would prevent you from installing a modern …

Member Avatar for stackOverflow
0
322
Member Avatar for nnobakht

Concerning this: [CODE]gets (argv);[/CODE] [B]NEVER[/B], ever, ever, [B]EVER [/B]use [COLOR="Red"]gets[/COLOR]. Forget that exist. You did not understand what Ancient Dragon was telling you. argv is an array of pointers to strings, where input could be used at the start of the program in command line. If you want to obtain …

Member Avatar for nnobakht
0
92
Member Avatar for Dark_Knight

[CODE=C]void modifyString(char *pstr) { char *str = pstr; // Make changes to str ... } void doSomething() { char str[] = "Hello World"; modifyString(str); }[/CODE]

Member Avatar for Dark_Knight
0
134
Member Avatar for silentdragoon

If all that you want to do is to remove the new line you could always look at the character before the nul terminator. [CODE]if ( words[i][ strlen( words[i] ) - 1] == '\n' ) { words[i][ strlen( words[i] ) - 1] = '\0'; } [/CODE] However since you want …

Member Avatar for Dave Sinkula
0
113
Member Avatar for dv1r

[CODE][COLOR="Red"]char[/COLOR] f; f=getch();[/CODE] getch returns an int. Therefore, f needs to be of type int.

Member Avatar for dv1r
0
187
Member Avatar for zuki

[QUOTE=arun_fire;505155]...But it wasn't as bad as you wrote about it. ....i do agree that main is recommended to return int under c99standard.but some systems like tuboc will allow it.[/QUOTE] It is human to err, but is stupid to continue in the err.

Member Avatar for timnfxr
0
102
Member Avatar for bobei89

[QUOTE=bobei89;500699]OMG this is the problem i get while use the functions warning C4013: 'strlen' undefined; assuming extern returning int[/QUOTE] strlen() is defined in the header file string.h. [B]#include <string.h>[/B]

Member Avatar for bobei89
0
680
Member Avatar for Lardmeister

[quote=Ene Uran;449472]I assume there are silly names like this for all presidential candidates. [/quote] No. Only to her.

Member Avatar for GrimJack
1
413
Member Avatar for sa-al

I am not quite sure I am understanding what you want in its totality. However it should be in these lines: Use fgets() to obtain pertinent information from user. Do calculation with the information. Store calculation in variable display the value in variable. What's sth? What do you intent to …

Member Avatar for ssharish2005
0
89
Member Avatar for jobs

strcpy() is not like printf() that accepts a format specifier as a parameter. You need to convert the integer into a string before trying to add it to the final buffer. Search for the function sprintf to do that.

Member Avatar for ssharish2005
0
116
Member Avatar for jobs

[QUOTE=jobs;497750] What is the problem here? I am running linux and gcc 4.1.[/QUOTE] You're compiler doesn't know what O_RDONLY is. Did you include fcntl.h?

Member Avatar for jobs
0
3K
Member Avatar for kv79

[QUOTE=elite1986;497681]Hi , The source is working but i do not understand how can work in line 68: the function without giving arguments. Thanks for reading.[/QUOTE] [CODE]int (*compare)(char *s1, char *s2); [/CODE] This is a pointer to a function that would have two parameters strings. [CODE]int reverse(char *p1, char *p2); int …

Member Avatar for kv79
0
76

The End.