949 Posted Topics

Member Avatar for lionaneesh

if(s[j] = z[i]) Test for equality, in this line of code, don't assign a value. Then go ahead with your logic. I believe you can delete the Dummy variable, entirely. ;)

Member Avatar for urbangeek
1
270
Member Avatar for tyliang

I think you might have a problem with the two stack.h files you've included. calcstack.h and stack.h are likely to have some of the same definitions and leave the compiler tied up in knots. Check for keyboard errors in your code, if they're supposed to be compatible. Were you supposed …

Member Avatar for mitrmkar
0
250
Member Avatar for piyushhbk
Re: C

Flashback to my old Math teacher, "Mad Dog" Cameron: ========================================== [B]"[/B] Oh NO! It's too e-a-s-y!! Can't you see that you need to add an unknown to this? Can't you see that you need to then just solve it for the unknown? It's too easy!! j-2, when j == 9, …

Member Avatar for Adak
-1
75
Member Avatar for nupurashi

These lines of code violate the C standard, and are ridiculous to boot. If you dared to write a line of code like that on a job, you'd be in trouble, for sure. You can't stop this kind of question (and this thread), fast enough.

Member Avatar for WaltP
0
101
Member Avatar for prade

Welcome to the forum. And no, I wouldn't do that. Turbo C is fine for just little assignments at school or home. Anything really good, you need to move up to something like MS Express or Code::Blocks - both are free, and have the kind of modern memory and features …

Member Avatar for jwenting
0
79
Member Avatar for kire
Member Avatar for ChrisXxX

[CODE]fscanf(FilePointer, "%f", &variableName);[/CODE] All the scanf() family of functions are subject to quitting the first time they receive data that they aren't set up to handle. It's important to check their return value to see if it actually worked or not, (it returns the number of items it has successfully …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Rmitboy

You have your string, and your width. You keep adding char's from your string (including the spaces), until you equal your width. If your last char is a space, or period (punctuation of some kind), then you're OK, as is. If you're in the middle of a word, then you …

Member Avatar for Adak
0
132
Member Avatar for dondajr

This sscanf() line looks dodgy to me. Test the return value it gives, and see if it's 2. [CODE] //Separa os indices sscanf(bdata, "[COLOR="Red"]%[/COLOR][^':']:[COLOR="Red"]%[/COLOR][^':']:[COLOR="Red"]%[/COLOR][COLOR="Green"]s[/COLOR]", p1,p2); printf("%s\n",p2); [/CODE] It has 3 [COLOR="Red"]%[/COLOR] char's in it, and 1 [COLOR="Green"]s[/COLOR] in it's formatting, but it's going into two variables?? If it's right, explain …

Member Avatar for dondajr
0
90
Member Avatar for dondajr

The more your program does, and the more efficiently it does it, the higher the percentage of cpu utilitization will be. That's not a bad thing. Sometimes just a few lines of code will generate 100's of lines of assembly or machine code. If your program is starting to have …

Member Avatar for dondajr
0
147
Member Avatar for Valdemar009

[QUOTE=Valdemar009;619080]Hi Everyone, I'm really fed up of working on C in Windows Vista. First and foremost, the window of C occupies only half the screen which is very annoying. I've heard that there is a distinct C that is used with Vista but I have failed to attain any more …

Member Avatar for jephthah
0
162
Member Avatar for sam_dev

[QUOTE=sam_dev;1171261]hi every body....... here i want to ask something about base64 algorithm which is used for the encryption of passwords.........i just want to know that how it works ?????what are the functions used in this algorithm?????any type help.....any link...????[/QUOTE] I'm not sure which cryptographic algorithms use base64, but here's some …

Member Avatar for jephthah
0
123
Member Avatar for aianne

You have codes for all of this and much more, if you have Turbo C! No one has to give you anything. :) Start up Turbo C/C++, and select "file" and "new". Now click on "File" again, and "save as". Give your file a short 8 character or less name, …

Member Avatar for Top9ne
0
1K
Member Avatar for churni

What's your compiler? Just for giggles, try this: [code] float a[N] = {0.0}; [/code] and you can delete char buff[] because it's never used.

Member Avatar for IsharaComix
0
89
Member Avatar for lionaneesh

Use fgets(CharArray, sizeof(CharArray), YourFilePointer); to put each line into the CharArray[80 or so], that you've previously declared. Now you can use for or while loops, to "walk" through the CharArray[], and pick out the tabs, and spaces, etc. When you find the line meets your needs, then put the end …

Member Avatar for Ancient Dragon
-1
163
Member Avatar for sudiptamondal

You can't run Turbo C graphics on another compiler. I couldn't compile your program in Turbo C, since it was missing a parameter (noted on the line in question, below). But Turbo C is pretty sweet for doing small assignments and programs. I use it a great deal. The first …

Member Avatar for hkdani
0
459
Member Avatar for aianne

You have codes for all of this and much more, if you have Turbo C! No one has to give you anything. :) Start up Turbo C/C++, and select "file" and "new". Now click on "File" again, and "save as". Give your file a short 8 character or less name, …

Member Avatar for WaltP
0
152
Member Avatar for urbangeek

After you enter something with scanf(), there will always be a newline char, left in the keyboard buffer. If you are scanf()'ing for a char, that is critical, because the newline '\n', is itself, a char. So when scanf() pulls in the char (the newline), it says "I've got my …

Member Avatar for urbangeek
1
557
Member Avatar for smi ensi

Here's some important things to do: 1) This is predominately an English language board. Translate your program into English, and re-post it. 2) In the advanced edit window, highlight your code and click on the [code/b]/b word at the top of the edit window. That will make your program look …

Member Avatar for jephthah
0
110
Member Avatar for ShortYute

Just use a different name - con is taken by the system. Doesn't matter how you try to get the program to use that name. System has first "dibs" on it. ;)

Member Avatar for Adak
0
113
Member Avatar for Xufyan

What about using char ch = 'a'; and then ch++; 26 times? char toCap = 'a'; toCap -= ('a' - 'A'); int integer = 0; integer += 'a' for lowercase, Now print it with a %c and with a %d :) And what would it be to change an integer …

Member Avatar for Xufyan
0
211
Member Avatar for lionaneesh

[QUOTE=lionaneesh;1167457]Exercise 1-11. How would you test the word count program? What kinds of input are most likely to uncover bugs if there are any? Exercise 1-12. Write a program that prints its input one word per line. help me wid these questions temme the source code and the logic and …

Member Avatar for Aia
0
179
Member Avatar for xavier666

In the case statement, in addition to the error of #2, you have a potential error in case #1. You are asking calloc to give memory of some number * the size of an int. But you don't want the size of an int, you want the size of an …

Member Avatar for Banfa
0
652
Member Avatar for anik biswas

You have a 1 in the 100's column, a 2 in the 10's column, and a 3 in the 1's column. So you could look to swap the columns: [CODE] 1 2 3 X 1 3 2 X 3 1 2 X 3 2 1 X 2 3 1 X …

Member Avatar for Adak
0
89
Member Avatar for Iam3R

Just main() means whatever the compiler accepts for it's defaults, are used. A return of int may also be the default of the compiler. int main () with no return should give you an error "function should return a value..." void main() is an error with the newest standards, AFAIK, …

Member Avatar for nezachem
0
226
Member Avatar for jaymeaux77

You could do a search that would be faster, but there is absolutely no need for that, in this game. A sequential search is fine! Some idea code - untested! [CODE] if(gameOn) loop for another player's turn else give congrats and goodbye message and exit this game in that function …

Member Avatar for jaymeaux77
0
4K
Member Avatar for bahr_alhalak

[QUOTE=bahr_alhalak;1163694]it's not a homework . come on ,, no one want to help me[/QUOTE] BA: I want to help you, but you will also need to understand: 1) Obviously, this is an assignment, of some kind. Which is fine, btw. 2) On forums, post up your info, don't attach it …

Member Avatar for jephthah
-2
125
Member Avatar for ammarZ

When you see code that so close to being exactly repetitive, it's time to look for better ways of doing this. ;) [CODE] int count_a; int count_b; int count_c; int count_d; int count_e; //etc. [/CODE] Just do a distribution count (aka bin sort), and be done with it. Use an …

Member Avatar for jephthah
0
115
Member Avatar for tquiva

A simple while loop before the char's you want, is all you need. [CODE]i = 0; while(str[i] < 'A') ++i; //get your good input here //then ignore the rest of the char's.[/CODE]

Member Avatar for WaltP
0
297
Member Avatar for DoEds

You will find it easiest using fixed lengths for each field, and thus a fixed length for each record. Every item then fits nicely into this struct (where each struct member is a field, and each record is a struct. A simple example: [CODE] struct item { long prod_num; char …

Member Avatar for Adak
0
1K
Member Avatar for trenzkun

Check out postfix and polish notation (or is it reverse polish notation?), anyway, they make doing this kind of parsing, rather easy.

Member Avatar for Adak
0
84
Member Avatar for Idontknowc

Wow! Edlin takes me back. Used it in my first computer language, BASIC. Now I find it hiding in WindowsXP, and still working!!

Member Avatar for Ancient Dragon
0
121
Member Avatar for nanosadra

You have a double linked list. If you want to print another node of that list (another structure's worth of data), then go to that node, and print it. You don't print a structure, from another structure. Structures just hold data, and are not "Objects" with the ability to print …

Member Avatar for Adak
0
214
Member Avatar for DoEds

[CODE] # printf("\nStudent [%d]\n",i+1); printf("Student name: "); scanf("%s",Stud[i].name); printf("Course: "); scanf("%s",[B][COLOR="Red"]&[/COLOR][/B]Stud[i].course); [COLOR="Green"]/* Course is a char array, so the name of the array is the address of the base of the array. Delete the '&'. */ [/COLOR] [/CODE] I did not review the rest of your code. If it still …

Member Avatar for DoEds
1
278
Member Avatar for hamilton168
Member Avatar for tien113

You need to draw an arc in order to get the (circular), cut-outs that your picture has. Instead of a triangle with "line, line, line", think NOT a triangle, and "line, arc, line, line, arc, line, and line arc, line". Once you learn to draw an arc, you'll have no …

Member Avatar for tien113
-1
199
Member Avatar for softapu

C doesn't know anything about a CD drive. Your computer knows about the CD drive, because it has a driver that handles it. C just passes the request along to the operating system, and the operating system passes it along to the driver. That's why you can't use a device, …

Member Avatar for abhimanipal
0
336
Member Avatar for phil750

The codes shown above this, require that your system has the ANSI.sys driver loaded. (shades of DOS!) I don't have it on my WindowsXP, system, so it won't work for me. If you're working or writing code for a Windows system, I strongly suggest you use the Windows API for …

Member Avatar for Adak
0
549
Member Avatar for sam_dev

Blowfish has been passed up by newer encryption algorithms that are faster and better. Most notably, by Rijindael. PDF on it is at: [url]http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf[/url] National Institute of Standards and Technology finished an exhaustive test of all the top encryption programs, and made their selection. Google N.I.S.T, encryption selection, and check …

Member Avatar for Adak
-5
99
Member Avatar for Idontknowc

look VERY carefully at Target and myaddressbook.name, and you'll see (I believe), one of them has a newline that the other doesn't have. That's what's tripping up strcmp(), and your search.

Member Avatar for Adak
0
93
Member Avatar for romariejhoanna

Wouldn't it make more sense to put each digit of one number, into it's own element of one array, and do the same with the second number, into the second array. Then, in a loop, starting at the one's (right hand column), start adding, and remember, any sum above nine, …

Member Avatar for romariejhoanna
0
242
Member Avatar for unbrknchane

While you're getting their name, don't you also want to get their exam score? Are you going to use parallel arrays student name <==> their score sharing the same index, or what's your plan for that? I like all the major functions to be up above main(). Easy to refer …

Member Avatar for Adak
0
111
Member Avatar for puhazholivin

We're not in the "given me code when I ask for it with a half-dozen exclamation points on the end", business. You must have us confused with some saps who think you deserve everything you ask for, when you ask for it, for free. ;)

Member Avatar for Adak
-2
44
Member Avatar for Silent_Friend

I don't know about helping you "get" code, but I can help you *write* code for this histogram. What do you have for input, (how is it organized, especially)? [B]Post up your code[/B] that you have so far - you do need to show some work, here - and make …

Member Avatar for abhimanipal
0
143
Member Avatar for aslk

This program shows how to do a simple selection sort (almost the same as a bubble sort), keying on one column of a 2D array. [CODE] /* shows how to a 2D array, using one column (the last column) as the key. */ #include <stdio.h> void printArray(const int a[3][4]); int …

Member Avatar for shah1248
0
154
Member Avatar for spursfan2110

Why NULL out any char's? Your buffer[index] is currently OUTSIDE a parenthesis or double quote, or And you program should start as OUTSIDE. Your buffer[index] is currently INSIDE a parenthesis or double quote. Both cases have to be dealt with. When buffer[index] goes INSIDE, then match equal's ')' or '"' …

Member Avatar for spursfan2110
0
104
Member Avatar for iNach

If it's for the screen, you should add some line of like this, inside your for loop: [CODE] for(i = 0; i < SomeBigNumber; i++) { if(i < 20) your print line of code goes here } [/CODE] That will let the only the first 20 lines of code be …

Member Avatar for mitrmkar
0
151
Member Avatar for donelliewhyte

On this forum, we try to NOT give out code, until after the poster (you), have shown some work to make the program. We want to HELP, not become "homework central" for every student who would like to have their assignment done for them. Do you see what I mean? …

Member Avatar for Adak
0
117
Member Avatar for uday.rnsit

Suggestions: 1) "Beginning C Programming" by Ivor Horton - fine book! 2) Many on-line tutorials, like the one on this very site (right hand side)--> 3) Keep reading a couple good and busy, C forums. You'll pick up a lot, and keep from forgetting what you've already learned. 4) Find …

Member Avatar for jephthah
-2
124
Member Avatar for johndoe444

Empirically, you have proven that it is indeed, too large. Remember, not only must that quantity of RAM be present, but it also must be contiguous. Also, you are asking for memory only from the stack. Try re-booting your system (to enable the largest RAM possible), and if that should …

Member Avatar for Salem
0
172

The End.