136 Posted Topics

Member Avatar for nateuni

[QUOTE=nateuni;998642]ok my bad I found out there was trailing crap from a previous scanf that was bunging things up.. and that flush is useless.... but I may have more questions.. so I want mark te thread as solved yet.[/QUOTE] You're making this more difficult than it needs to be and …

Member Avatar for nateuni
0
601
Member Avatar for konohastar

@konohastar. We'll let you off this time ;) since that was your first post, but in future please use code tags when posting code. You'll find members of this forum more willing to help you out if you do this. Read the material at this link to learn how to …

Member Avatar for konohastar
0
241
Member Avatar for van_tomiko

How about showing us what you have done so far? That would at least give people on this forum a good starting point as to how your problem could be resolved. It would also give us some indication as to your level of knowledge in C in general.

Member Avatar for yellowSnow
0
129
Member Avatar for spdr2006

First up, as a newbie, you need to learn how to post code correctly on these forums using code tags. You'll find that people will be more willing to help you out if you're prepared to show some effort in this area. Please read the information at the following link …

Member Avatar for yellowSnow
0
328
Member Avatar for nateuni

[QUOTE=nateuni;994616]I am getting this error message, but I am not sure what I am doing wrong? Here is a edited snip-it of my code - [code=c] void WriteProgram(clientProgram *ptrToProgram, int *ptrTotalWkOuts, int *ptrNumOfEx) { int wkOut = 0; clientWorkout *ptrToWorkout; int *autoPopulate = (int *) calloc(1, sizeof(int)); clientWorkout *ptrToFirstWorkOut = …

Member Avatar for Tom Gunn
0
673
Member Avatar for ching1007

Are you friggin' kidding us? You need to read this: [URL="http://www.daniweb.com/forums/thread78060.html"]http://www.daniweb.com/forums/thread78060.html[/URL] and then you need to read this (how to post code): [url]http://www.daniweb.com/forums/thread93280.html[/url] Good luck!

Member Avatar for yellowSnow
-1
58
Member Avatar for manavsm

[QUOTE=gattewar;995464][ ..i want to build an student database using linked list and in c language...but i am unable to create nodes for each variable like age,name,roll no,and also i have to implement in that the suboptions like modify ,search ,sort, create n display plz tell me how can i implement …

Member Avatar for yellowSnow
0
1K
Member Avatar for nateuni

[QUOTE=adatapost;995202]@nateuni: I have been reading about memset but my understanding is it will not work for a struct. I think [b]memset[/b] is the way to go. You do not have many alternatives.[/QUOTE] Yes. I agree. Here's a sample of code I posted about a month ago to another member asking …

Member Avatar for nateuni
0
130
Member Avatar for serkan sendur

I would suggest MinGW. A port of the GNU gcc compiler for Windows. Actually you get more than a C compiler, you get C++, Java and Fortran as well. If you're talking IDEs, then I would suggest Codeblocks or Eclipse - both use the MinGW toolchain.

Member Avatar for yellowSnow
0
2K
Member Avatar for Samyx

Add -Wall option when you compile. (ignore!!_ Sorry another brain fart. You need to pass the address of the parameters to your swap function like so: [CODE=C] swap (&i, &j); [/CODE]

Member Avatar for Samyx
0
81
Member Avatar for geoffy0404

[QUOTE=geoffy0404;994375][CODE]int main() { int assignment1[30]; " "; int assignment2[30]; " "; int assignment3[30]; " "; int assignment4[30]; " "; int assignment5[30]; " "; int assignment6[30]; " "; int totalPoints[] = "assignment1+assignment2+assignment3+assignment4+assignment5+assignment6"; printf(" Grade calculator ... By Geoffrey Prata \n\n"); printf(" Please enter your grades \(in points\) after \n each prompt …

Member Avatar for chesspest
0
119
Member Avatar for D_switch

[QUOTE=D_switch;991903] now im stuck as to how to display it in decending order[/QUOTE] Well you've almost done it. Change the comparison in your strcmp() to be "greater than" (>) to sort the names in descending order. In addition to studying up on why gets() is a poor function (use fgets() …

Member Avatar for D_switch
0
5K
Member Avatar for vileoxidation

This would have to be close to one of the most stupid assignments I've ever heard of. It just supports my claims on the quality of CS education these days.

Member Avatar for vileoxidation
0
123
Member Avatar for Sobakaa

Just having a quick look at your code, you're not declaring your variables of type SYM correctly - you need to prefix the declarations with "struct". If you don't want to do this, you'll need to use a typedef.

Member Avatar for Sobakaa
0
88
Member Avatar for edwar

You're sort of on the right track. How about trying it out for yourself and see what happens rather than constantly asking for examples. And then post back if you still have issues - your learning experience will be far better this way. Also, learn how to post code properly …

Member Avatar for yellowSnow
0
104
Member Avatar for sv_1124

Are you kidding me? Why are you posting this as a code snippet? You should have posted this in the C forum as a "normal" thread". And quite frankly unless you are willing to put some effort in and pinpoint the minimal code that demonstrates your problem, I'd guess you're …

Member Avatar for tux4life
0
253
Member Avatar for kyumi419

A supposedly different thread in disguise. For the OP - stop wasting everyone's time by creating a new thread when you haven't even bothered with the pending conclusion of your most recently related thread: [URL="http://www.daniweb.com/forums/thread222917.html"]http://www.daniweb.com/forums/thread222917.html[/URL]

Member Avatar for kyumi419
0
108
Member Avatar for priyabalu87

@dkalita, We do not freely give out code on these forums unless the poster shows some effort. Since you are a "newbie", you need to read this: [URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL]

Member Avatar for dkalita
-1
142
Member Avatar for Kombat

You're making this more difficult than it needs to be. Look at this code snippet: [CODE=C] while (d != 0) { r = d % b; d = d / b; result[len++] = basechars[r]; } for (i = len-1; i >= 0; --i) { printf("%c", result[i]); } [/CODE]

Member Avatar for yellowSnow
0
2K
Member Avatar for TGeorge824

[QUOTE=wheel;988438]Other than adding the "&" to the scanf statement . . . Why do you do the following loop? [CODE] while(x<=num) //Checks the numbers for their status { detect(num); x++; } [/CODE] If you want to check all numbers between 2 and num, then you must detect(x) rather than detect(num). …

Member Avatar for yellowSnow
0
95
Member Avatar for chathu12

How many times do you need to be told to use code tags? It's the third time I have asked you to do this. The strtok() function has its pitfalls which have been well documented - do your own research on this. Since this is more than likely an assignment …

Member Avatar for dkalita
0
164
Member Avatar for MrNoob

[QUOTE=MrNoob;985829]or i have to declare normal structure of same type and make the ptr get its address ?[/QUOTE] You can do it that way, or allocate memory to your structure pointer as in: [CODE=C] em1 = malloc( sizeof(*em1) ); [/CODE]

Member Avatar for yellowSnow
0
128
Member Avatar for ubi_ct83

For the OP - if I'm understanding your issue correctly, you are still experiencing problems getting the strcmp() function to return the fact that two strings are equal. This is happening because the fgets() function stores the newline character into the buffer and then you are comparing this buffer to …

Member Avatar for ubi_ct83
0
614
Member Avatar for pk09

[QUOTE=keerthiga;981253]sum() integer x,y,z read x,y z=x+y print"the sum of x and y is",z end sum()[/QUOTE] In the relatively short time I've been participating in this forum, this would have to be one of the most irrelevant answers to a thread I have seen. keerthiga, did you actually read the OP's …

Member Avatar for 9868
-1
125
Member Avatar for anujsharma

It can't be that urgent if you can't even take the time to post an actual question. Try again - and ask a question this time.

Member Avatar for anujsharma
0
133
Member Avatar for furqankhyraj

Besides all the other "evils" in your code that others have pointed out already, the logic of your max() function in your last post is incorrect. It appears to be returning the minimum value out of the three values passed in to the function. You should consider yourself lucky that …

Member Avatar for yellowSnow
-2
91
Member Avatar for Gaiety

When using the sizeof operator with a type name, it must be enclosed within parentheses.

Member Avatar for kvprajapati
0
292
Member Avatar for chathu12

[QUOTE=chathu12;964235]Hello Every one, I need to write a program to copy a part of a String from a specified place. Eg: if the first String looks like "This is a C program" I need to extract the part of "C program" How can I do this.Please help me. Can I …

Member Avatar for yellowSnow
0
138
Member Avatar for chathu12

[QUOTE=chathu12;964110]Hello every one?I have a program use to copy the contents of an array to a File.But it does not work. when it runs Visual Studio starts to debug. But nothing happening.File contents does not change.Please help me tho solve this problem.Thank you very much. Here is the program. [CODE]#include<stdio.h> …

Member Avatar for chathu12
0
142
Member Avatar for nateuni

[QUOTE=siddhant3s;961806]>1. Passing into a function and then into a sub-function. Did you asked Google? Anyways, I did it for you: [url]http://www-ee.eng.hawaii.edu/~dyun/ee160/Book/chap6/section2.1.2.html[/url] >2. Passing 2d arrays, this had just mucked me up. [url]http://www.physicsforums.com/showthread.php?t=270319[/url] and [url]http://cboard.cprogramming.com/c-programming/97898-passing-2-dimensional-array-function.html[/url] >3. Making comparisons between pointers and ints Sorry I did not got this properly to make …

Member Avatar for mrnutty
0
214
Member Avatar for nateuni

Change this line: [CODE=C]saveToFile(*client_file, &client);[/CODE] to this: [CODE=C]saveToFile(client_file, &client);[/CODE] In addition to this, you should also check that the call to fopen() is successful - Salem gave you the code for this check in post #8. Good luck!

Member Avatar for nateuni
0
367
Member Avatar for dumbncool
Member Avatar for Aia
0
150
Member Avatar for hket89

[QUOTE=hket89;959943]Erm, such like syntax error that kind, got what other type of error else?[/QUOTE] What on earth are you talking about? Follow the rules of the forum and ask a proper question.

Member Avatar for LordoftheFly
0
191
Member Avatar for chathu12

> Hello every one.I coded a program to print current date and time. > First I declare a function tim() to calculate the current time. > It works well.But the problem is I cant call the function from main() function.It doesnt print any thing.What is wrong with this code? > …

Member Avatar for yellowSnow
0
103
Member Avatar for anujsharma

Help is given to those who help themselves by showing some effort. Perhaps you should post some code.

Member Avatar for anujsharma
0
126
Member Avatar for notsogood

It's no point posting ~500 lines of code and then asking someone to "fix" your code. Make an attempt to post the smallest amount of code that isolates your problem. You never know, by trying to do this you may actually work out what the problem is for yourself. A …

Member Avatar for notsogood
0
108
Member Avatar for chathu12

In your haste to post your poorly formatted code, you may have missed the opportunity to read the sticky notes at the top of the forum page. In particular, how to ask questions properly and how to format code using code tags. Read these notes and try again. [URL="http://www.daniweb.com/forums/thread78060.html"]http://www.daniweb.com/forums/thread78060.html[/URL] [URL="http://www.daniweb.com/forums/thread93280.html"]http://www.daniweb.com/forums/thread93280.html[/URL]

Member Avatar for chathu12
0
5K
Member Avatar for revatijadhav

Are you talking about calling Java from C? If so, you'll have to make use of the JNI. I've only done it the other way round - Java calling C through the JNI. Perhaps this article may be useful (it's not for the faint-hearted): [URL="http://java.sys-con.com/node/45840"]http://java.sys-con.com/node/45840[/URL]

Member Avatar for maks91
0
123
Member Avatar for notsogood

[QUOTE=notsogood;959377]Hi thanks so much for the other corrections. And.. about the problem, I have been saving my file as filename.cvs.txt all along. So I reverted it to the .cvs extension and there's nothing wrong with the reading. Please declare this thread as solved, but I may post another problem regarding …

Member Avatar for yellowSnow
0
171
Member Avatar for katwalatapan

[QUOTE=katwalatapan;959175]Thank you very much for the prompt reply. It does store the element "putval[0]" in "b[0]", but how should i approach, if I want to return the whole "pulval" array into "b"[/QUOTE] I'm not sure what you're trying to do - seems awfully convoluted for a "long to hex" conversion. …

Member Avatar for katwalatapan
0
137
Member Avatar for gn00495555

And your question is? Please refer to this link: [URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL] While you're at it, as a "newbie", you should read all the sticky posts at the top of the C forum page.

Member Avatar for yellowSnow
0
158
Member Avatar for bryangarcia

[QUOTE=bryangarcia;955809]the user will enter his/her month and day of birth and the program should display the corresponding zodiac sign and the character and personality of the person having that kind of zodiac[/QUOTE] The problem with your code is that your case labels are wrong. Case labels must be some form …

Member Avatar for yellowSnow
0
103
Member Avatar for cmsc21_scared

Please read the "sticky" posts at the head of this forum. Show some effort (even just a liitle)! [URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL]

Member Avatar for Dave Sinkula
0
290
Member Avatar for osei-akoto

[QUOTE=osei-akoto;952719]Please can anybody tell me the difference in return 0 and system ("pause");[/QUOTE] [B]return 0[/B] means the value 0 (usually some type of int) is returned from a function to the caller of the function. [B]system()[/B] is a library function that makes calls to OS commands/programs. [B]system("pause")[/B] calls the "pause" …

Member Avatar for Tom Gunn
0
4K
Member Avatar for no1zson

Hello, yes it's me again. I cannot believe you. I gave you a full blown working version of what you're looking for and you still keep on insisting on posting versions of the code that don't work. I spent a great deal of time in your PM response (which you …

Member Avatar for no1zson
0
250
Member Avatar for osei-akoto

Do you want to actually post the code with regards as to what you want to do? It's blank!

Member Avatar for Salem
0
76
Member Avatar for rakesh_01

Well ... if you have an idea on "how to do it" then post some code or at least a reasonably detailed plan on how you intend on approaching the solution. Code talks ... everything else walks.

Member Avatar for Ancient Dragon
0
362
Member Avatar for no1zson

I gave you a clue to this issue in your thread titled "GOTO command -C". You need to "consume" the '\n' character left over from when scanning the store number. Read my post again in that thread. In your iMenu() function, replace: [CODE=C] scanf("%d", &iSelection); [/CODE] with this: [CODE=C] scanf("%d%c", …

Member Avatar for no1zson
0
174
Member Avatar for osei-akoto

[QUOTE=osei-akoto;952688]I have not taught of it yet but i know i have to use gui. After i have know what to do i will then figure it out. Please help me.[/QUOTE] You are "sort of a new programmer" and you want to start out programming GUIs. How about learning some …

Member Avatar for yellowSnow
0
116
Member Avatar for cooldev

You're sort of close. I'm not absolutely clear of your exact requirements (with regards to what to do with word boundaries). Look at the following code. I have hopefully simplified things for you a bit. Bear in mind that this program just outputs exactly "limit" characters per line (except perhaps …

Member Avatar for yellowSnow
0
75

The End.