76 Posted Topics
Suppose the user wants to input a string. The length of the string is unknown. I also don't want a character array of size 1000 or what so ever. I want the size of the character array increasing by 1 byte for every character entered. Here is a sample output … | |
Re: Also don't use [icode]conio.h[/icode]. It is not a part of the standard C library. I guess you're compiler is quite outdated. I recommend [URL="http://sourceforge.net/projects/codeblocks/"]Code::Blocks[/URL] | |
Re: Are you trying something like this? [code] * * * * * * * ********* [/code] If possible, try to generalize the program for a triangle of order n (where n could be the height). One method of solving this could be for you to first develop a program for … | |
I was making a DEQUE program utilizing two separate lists for forward and backward traversal. But what I think I've done is ended up making [U]two separate lists[/U], having same data but only their [U]order reversed[/U], thus wasting memory :'(. So what I want to know is this how a … | |
Re: [QUOTE=Ancient Dragon]An example you can see here occasionally [icode]a = c++ + ++c;[/icode] The result of that expression is undefined because (most likely) it violates the rules you cited. Consequently the result store in a will be whatever the compiler writer decided it to be.[/QUOTE] [I]It recently came to my … | |
I just made a 'Hello World' program [code] #include<stdio.h> int main() { printf("Hello World\n"); return 0; } [/code] [code] exe file size = 15.5 KB Source file size = 79.0 B [/code] Then i made a data structure program (implementing stack, queue, deque) [code] exe file size = 21.9 KB … | |
Re: Strictly speaking, this problem is not recursive in nature. What you can do is to let the function call itself (while traversing through the array) and with the help of some conditional operators check when the predefined sum is equal to the running sum inside the function. But this is … | |
Re: Points to be noted, raghuhr84 [list] [*]Give the complete program, that is, give [icode]#include<stdio.h>[/icode]. Becomes easier for us to check. [*]Use proper indentation [*]Use code tags around your program (See the forum rules) [/list] The problem is that you have not flushed stdin. Put [icode]fflush(stdin);[/icode] before the [icode]scanf[/icode]. That should … | |
Re: All this looks very exciting but you have got to understand that some of us don't understand Bulgarian (Had to Google it and I'm still not sure). Please convert the program outputs & comments in English. You should have read the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]forum rules[/URL] which clearly states to write "in full-sentence … | |
Re: I was expecting someone to explain him the problems about his code. Ah well ... Hi harshchandra, Thank you for presenting your code snippet but your code has some major faults, hence lost it's appeal. Your program displays the bad practices of C. They are as follows [list] [*][icode]conio.h[/icode] - … | |
Re: [QUOTE=Micia]but she didn't taught us how to[/QUOTE] She didn't teach you because it's for you to figure out (of course I'm assuming your teacher has taught you the basics) [QUOTE=Aia]You missed to read the rules of the forum. We don't give any code away without you posting what you have … | |
During run-time of a menu driven program, I want the user to see what option the user has entered. Something like this :- [CODE][OUTPUT] . . . Enter Option : [1] <- [I]User given[/I] Press Any Key To Continue ... [_] <- [I]Blinking Cursor[/I] . . . [/OUTPUT][/CODE] After I … | |
Re: Don't listen to them endofworld201, I'll help you cheat. Here is my code, follow this and you'll be way ahead of your class before you know it [CODE] #include<stdio.h> int main() { printf("\nRead the forum rules"); printf("\nRead your C text book"); return 0; }[/CODE] | |
[INDENT]Hello everybody, I just started learning C and decided to join this site. But as soon as I posted some of my code snippets here, immediately I got a stream of insults (thanks to [icode]conio.h[/icode]). But it's not my fault, I've grown on [icode]clrscr()[/icode] and [icode]getch()[/icode] (due to my experience … | |
Re: It can be done using strings though. But I've not thought about it yet. The nature of this problem is similar to adding two 50 digit decimal numbers which has to done by strings | |
Re: keyzzz_it, please provide the complete program, along with the header files. It seem that you have provided a very sketchy program. Give the complete program within code tags. It's beneficial both ways | |
Re: The errors were :- [list] [*]Writing [icode]%C[/icode] instead of [icode]%c[/icode] [*]Placing the brackets incorrectly [/list] The corrected code is as follows:- [CODE]#include <stdio.h> #include <stdlib.h> //GIGO.c- Coded by Ross Camarillo aka Bubonic_88 // on 12/02/2009 //Created by Randy Gibson #define SYMB '*' // character to show in the letters void … | |
Re: Here is the make-shift algorithm [list] [*]Take the number to be worked upon from user. Call it NUM [*]Try to find a number from 1 to half of the NUM which divides NUM and leaves no remainder [*]If you find such a number, check whether the number is prime or … | |
Re: First of all meghs, your pattern is not properly indented, it should be [CODE] * * * * * * * * * * * * * * * *[/CODE] Second, you should have shown us how much you have tried. Let your code be full of errors, we'll point … | |
Re: If your aim is to do the thing in one line, you can use ?: [CODE]salesTrend = (soldYesterday > soldToday) ? -1 : 0[/CODE] | |
Re: Is there a seperate function provided by C to sort and swap? [QUOTE]Sort values in an array without using sort functions (Urgent) [/QUOTE] What does this mean anyway? Are you asking to make a custom sorting function? | |
Re: Please for Christ's sake give the complete program | |
Re: You can also do this [code] #include <iostream> #include <conio.h> using namespace std; int main() { int hiya; cout<<"hello world \n"; getch(); cout<<"enter a number \n"; cin>>hiya; cout<<"you entered \n"<< hiya; getch(); }[/code] | |
[B]This is just a linked list program for those who need help understanding the fundamentals. Put comments if you find some bugs. The program is about maintaining a student database (their roll number and their age) I've used Turbo C++ 4.5 as the compiler[/B] :icon_cool: | |
Re: [code=c++] #include <stdio.h> int i; int j; int row; int column; int sum[10][10]; int sub[10][10]; void dimension(void) { printf("\n\n\tEnter The Dimensions Of The Matrix : "); printf("\n\n\t\tROW : "); scanf("%d", &row); printf("\n\n\t\tCOLUMN : "); scanf("%d", &column); } void display(int *m[][10],int r,int c) { for(i = 0;i < r;i++) { printf("\n\n\t"); … | |
Re: Seriously, how much effort does it take to write code and /code within brackets. And Fran, i wrote a calendar program in the forum. Take a peek at it. Make sure to delete all clrscr() and #include<conio.h> |
The End.