1,088 Posted Topics

Member Avatar for locy

[quote=locy;452801] where did i make mistake[/quote] The success of your program hinges upon your ability of understandig first how to get the total addition of each digit of an integer. I hope this will clarify for you how to do so. [code=C] /****************************************************************************** 01234 is made out of 1000 + …

Member Avatar for Aia
0
98
Member Avatar for Dave Sinkula

[quote=jasimp;446448]Can conservatives do anything accept bash liberals?[/quote] Yeah, we work for a living, without coveting anyone else's money in any form of social program.

Member Avatar for hopalongcassidy
0
196
Member Avatar for Aia

You have a problem with your code. You need help. You are in a hurry. What can you do? Post for help at Daniweb as fast as you write, correct?. Wrong. The first thing you should do is to read the rules on posting and specially how to properly make …

4
2K
Member Avatar for near

Your program doesn't compile because you have a char variable name: [B]char words;[/B] and another integer variable array with the same name: [B]int words[WORDS_SIZE] ; [/B]Why do you insists in using[B] gets (string); [/B]here and here int words[WORDS_SIZE] = {[B]gets (string)[/B]}; when Narue already told you: "Don't ever use gets. …

Member Avatar for near
0
226
Member Avatar for bobei89

[code]int freq[11]={0}; //why make freq[11] for 11 variables?//[/code] Valid user input is from 0 to 99. You divide that range in units of 10 and you get ten groups. The extra variable is to hold an extra group for any possible input from the user beyond that range. In other …

Member Avatar for bobei89
1
153
Member Avatar for beatlea

[code=c] char *cmd[100]; /* this is an array of pointers */ char argument[100]; /* this is just ONE array of 100 elements long */ cmd[i]=argument; /* Each time a new pointer element is pointing to the same array string */ [/code] You are changing the string every time through the …

Member Avatar for Aia
0
116
Member Avatar for locy

[quote=locy;450248]how do i write a C programm with the output ++++++ or *******[/quote] Give it as an argument to the printf() function, or learn how to use a [URL="http://www.geocities.com/learnprogramming123/Clesson9.htm"]loop[/URL].

Member Avatar for Lardmeister
0
149
Member Avatar for pedro martinez

Pedro, welcome to the forum. If I understand you correctly what you need is to parse the lines into individual tokens. Take a look at this [tutorial](http://www.daniweb.com/code/snippet444.html). Next time make sure you encase your code in CODE tags. That will ensure proper format of the code and easiness of read.

Member Avatar for Aia
0
92
Member Avatar for locy

[quote=locy;450278]i try to intsall cygwin but i got a problem,is there any easy one that i can understand.i m a beginner in programming[/quote] [B]FWIW[/B]: Some [URL="http://www.geocities.com/learnprogramming123/Cdownload.htm"]compilers[/URL].

Member Avatar for dwks
0
148
Member Avatar for mooseguy

[quote=mooseguy;447967]Yes, but how would you get the letters?[/quote] [code=C] for ( i = 0; i < 25; i++ ) { printf( "%c: %d", 'A' + i, letters[i] ); if ( ( i + 1 ) % 4 == 0 ) { putchar( '\n' ); } else { putchar( '\t' ); …

Member Avatar for Aia
0
83
Member Avatar for furpacino

[B][B]>Helppppppppppppppppppppp i will kill my self soon[/B][/B] It will a waste of time to help you if you are going to kill yourself soon. What's the point of helping? Now, if you change your mind about the minor problem, you could always make a stop to read the rules about …

Member Avatar for Ancient Dragon
0
159
Member Avatar for Exsiss

[quote=Exsiss;448030] Can you give me a few lines of example for it? I just need a point in the right direction.[/quote] A few lines is all that is needed, and I am afraid that would rob from you the experience of learning. Look at this and give it another try. …

Member Avatar for Aia
0
85
Member Avatar for use4d

[quote=use4d;446158] (e) DO THIS ONCE A DAY ONLY UNTIL NEW HAIR GROWTH APPEARS[/quote] And if that fails at least you'll always have a shinning head. ;)

Member Avatar for efmesch
1
97
Member Avatar for ITapprentice

[code] struct inFile { char itemNumber[32]; int timeToFinish; int elapsedMinutes; }; typedef struct inFile inFile;[/code] You create a structure data type and even typedef but you do not define any variable of type structure for your main to use. [code] fscanf(fn, "%s, %d, %d,", inFile.itemNumber[i], inFile.timeToFinish[i], inFile.elapsedMinutes[i]);[/code] You are forgetting …

Member Avatar for Aia
0
117
Member Avatar for Dave Sinkula

Yeah, I am for it. It should show as `invisible [B]aka[/B] Dave Sinkula'. ;)

Member Avatar for Aia
0
87
Member Avatar for furpacino
Re: help

[quote=furpacino;443526]oke i am sorry for before i didnt know about this side so much. Now i am sending a file with attachemnt. I have to rewrite this while loop. if you help me i will presuade about your helps.[/quote] [B] *Whew*[/B] We were so concern that you would take such …

Member Avatar for Aia
0
115
Member Avatar for theraven1982

[quote=theraven1982;443388] [code=c] void initialpos(struct atom *name, int N) { int i; for (i = 0; i < N; i++) { name[i].x=drand48()*20; name[i].y=drand48()*20; name[i].z=drand48()*20; printf("pos of %d: %f\t %f\t %f\t \n", i, name[i].x, name[i].y, name[i].z); } } [/code] [/quote] Taking this as an example: [COLOR=Red] name[i].x=drand48()*20;[/COLOR] You are assigning to a …

Member Avatar for theraven1982
0
21K
Member Avatar for abhishekgahoi

[quote=abhishekgahoi;442491]#include <stdio.h> int main() { int i=5; printf("%d %d %d %d %d", --i,i--,++i,--i,i); return 0; }[/quote] [URL="http://c-faq.com/expr/evalorder2.html"] Undefined Behaviour[/URL].

Member Avatar for Aia
0
179
Member Avatar for sakthi_2001

[quote=sakthi_2001;442740][...] to find sum of digits of a 5-digit number without using control statements, like if, for... thank you[/quote] [quote=twomers;442769] make an array, loop through, and sum: [/quote] Read the question again?

Member Avatar for twomers
0
718
Member Avatar for aldrinsms

[quote=aldrinsms;440865]How to make a program yhat make the transpose of a matrix using C ofcourse.[/quote] Did you read anything in this thread that indicated or makes reference to your particular question? Please, post your question in a new thread of its own. However, before doing that, use the search bottom …

Member Avatar for Salem
0
90
Member Avatar for fatihpiristine

[quote=fatihpiristine;441854]Hello guys, I want to improve up my skills programming in C and Phyton on Linux. I have no idea which version of Linux is good to do this. So far I have tried Fedora 7, Slackware and StartCom Enterprise. I couldnt find what I really want. Few years ago …

Member Avatar for Salem
0
101
Member Avatar for BigFormat

[quote=Narue;441248]>Since 'A' is the internal value 65, 'B' is 66, 'C' is 67, and so on, >subtracting 'A' from your letter will give you 0, 1, 2, and so on. This is a non-portable assumption.[/quote] Are you refering to [B]Extended Binary Coded Decimal Interchange Code[/B] ([B]EBCDIC[/B])?

Member Avatar for Salem
0
435
Member Avatar for alsoumhi

If I may I would like to make an observation. In order to return a string from a function to main, is necesary an understanding of pointer variables and variable scope. This code will never work: [code=C]#include <stdio.h> char *mystring() { char s[] = "I don't see the point"; char …

Member Avatar for Rashakil Fol
0
106
Member Avatar for khalid0404

[quote=khalid0404;436865]the new algorithm will consist of combining Huffman and Shannon-Fano coding system, which will be later translated in C language. Any proposals???[/quote] Go ahead!. Post it afterward.

Member Avatar for khalid0404
0
114
Member Avatar for gaowei

Some error I found. By any means not the only ones. I did not pay attention to the logic of your program. I am sure that there's need to considere that part too, [I][B]id est[/B][/I] free any of the dynamic memory that you call after been used. [code=C] #include "stdio.h" …

Member Avatar for Aia
2
177
Member Avatar for gplkrsna

I am kind of confuse now. I always thought a literal string was [B]static [/B]and [B]constant[/B]. Which made me believe that it would be part of the [B]static memory[/B], like a [B]global static variable[/B]. And that it would be undefined behaviour if you tried to change it by using a …

Member Avatar for Narue
0
150
Member Avatar for BigFormat

[quote=BigFormat;430079]Hi guys, I've got troubles with a conversion. [/quote] [code=c] int *numbers[nums]; /* this is an array of pointers of type int */ char *p; /* this is a pointer to a string */ numbers[i] = p; /* You are trying to assign a string to an element of the …

Member Avatar for BigFormat
0
159
Member Avatar for Ballar32

[code=C]scanf("%s",&make); scanf("%s",&model); scanf("%s", &color); scanf("%s",&plate); scanf("%s ",&sfname);[/code] These will have an effect that you did not intended. The format %s is for strings or arrays of type char, and when you pass it to scanf you don't need the & operator. Futhermore you have declared those variables as a single …

Member Avatar for Ballar32
0
267
Member Avatar for Aia

What would be the command in the XP cmd.exe to connect and access a smb shared directory from another XP box? Thank you.

Member Avatar for Aia
0
79
Member Avatar for zite.1
Member Avatar for Narue
0
112
Member Avatar for shoby

[code=c]Given the matrix array: char matrix[][4] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l' }; Transpose means the rows becoming colums and the colums becoming rows. Calling the first element of the first dimesion subscrit will produce the first transpose row: matrix[0][0] 'a' matrix[1][0] …

Member Avatar for Aia
0
207
Member Avatar for gaurav252

[quote=Hamrick;429060]If printf didn't return a value, it would return void. There aren't any values of void type, so something like this shouldn't ever compile. That means it's not valid. [/quote] printf() always returns an int. Not a void type. If an error happens it will return a negative integer for …

Member Avatar for Ancient Dragon
0
107
Member Avatar for >shadow<
Member Avatar for Serunson
0
2K
Member Avatar for Firestone

> I understand what pointers are, but I don't understand why they are useful. >Good god that is long, but it looks useful thanks! Many pages have been written in articles, tutorials and book chapters about [B][I]pointers[/I][/B] in C programming. A typical approach would be to explain how a variable …

Member Avatar for VINEET KUMAR
0
181
Member Avatar for amishosh

[quote=amishosh;421529] When compiling with Borland C it worked fine. However when I tried cimpiling it with VS 2005 I got the following error: "Unhandled exception at 0x00413529 in Learning C.exe: 0xC0000005: Access violation writing location 0x00415645." But based on what I learnt in C I don't understand why it did …

Member Avatar for Salem
0
190
Member Avatar for NycNessyness

I must confess I am a little confused concerning this part of your question; >And my last problem that I'm having is with letting the user type in their full name while using only one variable instead of three like I have it. and also these portions of your posted …

Member Avatar for Aia
0
464
Member Avatar for hus2020

To read integer and floating-point values you need to learn how to use two functions: fgets() to read it and sscanf() to obtaing the value from the string read by fgets(). Here's two snippets of how this might be achieved. [URL="http://www.daniweb.com/code/snippet266.html"]Read an Integer from the User[/URL] [URL="http://www.daniweb.com/code/snippet357.html"]Read a Floating-Point Value …

Member Avatar for Aia
0
81
Member Avatar for mohammadalipak

>it is still 0x7803a710. I was expecting it to be freed to 0x00000000. Your expectation is not realistic. Freeing some memory do not mean that is zero out. It means that is available for other uses. A perfect example would be if you declare an int variable and do not …

Member Avatar for TkTkorrovi
0
1K
Member Avatar for NycNessyness

[quote=NycNessyness;414840]I'm still trying to figure out how to get the calculations to work in my program. If someone can shed some light on that area for me, it would be greatly appreciated. Thanks again.[/quote] Without trying to discourage you, I have to say your code is full of errors. My …

Member Avatar for NycNessyness
0
888
Member Avatar for chelo77

There's quite a few things wrong in you function. Compare with this. File is not the same that FILE. File *fp is not a string. ptr == fopen is not the same that ptr = fopen. [code=C]void write_string( char *fp, char *s) { FILE *ptr; int i; ptr = fopen( …

Member Avatar for Aia
0
208
Member Avatar for grii_19

[quote=grii_19;416220]i thought the functions part would be simple but giving me a lot of headache now i tried passing 2 values int and float but again same error ? can ne1 tell why ? referring let us c using tc . assume in square function above what are the lines …

Member Avatar for Aia
0
815
Member Avatar for sk8ndestroy14

[quote=joshSCH;399504] Perhaps she is logical; however, one must be quick witted in the game of chess.. Smarts, logic, luck.. all play a good part. [/quote] Luck doesn't have anything to do with it. If you need luck to win, then you need to keep practicing. ( Talking in generic terms …

Member Avatar for sk8ndestroy14
0
254
Member Avatar for kgbalaji1980

[quote=kgbalaji1980;415291]Hi, I need help for this C Program very urgent. please find the attachment below[/quote] Post what the program is suppose to do, and what is not doing correctly. Post any error messages you are getting at compile time, in essence tell us what's the problem that you are having …

Member Avatar for Ancient Dragon
0
120
Member Avatar for pranay500866
Re: .exe

[quote=TkTkorrovi;415534]Well the easiest, if you have only one input file, is [code] gcc something.c -o something.exe [/code] But better is [code] gcc -std=c89 -Wall something.c -o something.exe [/code] This is for windows, in linux the executables usually have no extension, they can have, but exe in linux is kind of …

Member Avatar for TkTkorrovi
0
98
Member Avatar for mona1nine

What's your question?. Post what is this program suppose to do. What kind of malfuntions it has, what copiling errors you recieve, etc, etc,...

Member Avatar for Aia
0
92
Member Avatar for NewbieTJ

I believe that more people are going to help you if you post your code , instead of send it as an attachment. Your code is not as long as to need to be an attached file. You need to work in the formatting of the source file. As it …

Member Avatar for Aia
0
99
Member Avatar for ellenski

[B]As a way of explanation: [/B]When you pass an argument to a function, that variable is always a copy of the one passed. Except pointers and strings made out of char arrays which are pass as a reference and not a value. Said that, let's take this function as a …

Member Avatar for Aia
0
166
Member Avatar for NewbieTJ

>What does it need? It needs to be sanded down all the way from 120 to 150 grit sand-paper. After that it needs a 3 coats of polyurethane, waiting at least a couple hours in between coats. Make sure you sand with 480 grit the finish between coats. Oh!, You …

Member Avatar for Aia
0
145
Member Avatar for jamello

It's a good thing she is 18 years old. Which it would mean I don't have anything to say any more. She was old enough to get pregnant, she's old enough to start taking decisions in her life. I would be happy to give any sugestion if she asks me. …

Member Avatar for The Dude
0
291
Member Avatar for DeathEvil

[quote=DeathEvil;414540]with sprintf i got some more luck, but when I print it later on, there is some junk that is printed after it [/quote] If printf is displaying garbage is because you are missing the '\0' ( null terminator ) at the end of the string. You need to add …

Member Avatar for Aia
0
97

The End.