147 Posted Topics
Re: Hmmm birthdays are good for health, the more you have the longer you live. Read it somewhere... | |
Re: Yes, but you can't do them portably. If you are using borland or visual C++ compilers you can try the getch() or getche() function to do that. | |
Re: [QUOTE]It is never safe, that's why.[/QUOTE] Is it because the user can overflow the buffer by entering more characters than the array or the pointer can hold? If that is the reason then scanf(), cin>> they are also not safe. So why blame gets() only? Or is it because gets() … | |
I've recently swithed from borland C++ 5.5 to MinGW. When I try to compile a .c file using gcc it compiles fine, but when I try to compile a .cpp file using gcc it produces a bunch of errors with c++ specific constructs. If I compile .cpp files with g++ … | |
Re: Try solving acm problems [color=#008000][b]acm[/b].uva.es/[b]problem[/b][b]set[/b]/[/color] | |
Re: that's because your ans is of type int. Try this instead: [CODE]char ans[/CODE]. In C char literals like 'y' and 'Y' are actually of type int, but in C++ they are of type char. And try to declare your array atleast a size greater than the total no of elements … | |
Re: I am not quite sure, but I think geek is used in a negative sense these days(big deal! like no one knows!!). I think I heard something like "Geeks are born, but nerds are made." From the quote it looks like nerd is a class upper than geek. May be … | |
Hello guys, It's about time I get a new computer and I thought it better be a laptop this time. I am looking to buy a laptop which will be just as good as any modern desktop pc with all the functionalities. I dont care much about portability and weights, … | |
Re: [QUOTE=scoobie]Hi, i am very new to c and was wondering if anybody can help me. i want to create an array of size 1 million bits. i heard you can use malloc or calloc. does anybody know how to do this, thanks in advanced, sc[/QUOTE] Arrays and even calloc and … | |
I wanted to explore and know about the GUI toolkits available to be used with C or C++. I heard a bit about Qt, GTK, Mingw etc, and there's MFC too. For the moment I am not quite sure which one to start with. Does a programmer need to know … | |
Re: Daniweb looks nicer, but I didnt like the yellow bars, is there no better shades like light green or light red? This is NOT a complain: And I guess almost all the members have been demoted :(. I am a junior poster back again. | |
Re: Big task. Luckily, some people have already done some work. [url]http://www.swox.com/gmp/[/url] If you want to implement on your own, then goodluck. I myself only implemented integers with trivial addition, subtraction and multiplication. | |
Is there any way I can know which company or organisation is hosting a particular domain name or website. For example: suppose I want to know which organisation is hosting [url]www.daniweb.com[/url] (just an example). How do I find out? | |
This is probably a stupid question, but i dont get the answer. Plz help me understand. Question: How could a linked list and a hash table be combined to allow someone to run through the list from item to item while still maintaining the ability to access an individual element … | |
I have taken permission from one of the sites to use their cool flash intro in my personal weblog. They gave me the permission but the only problem is that after the intro is finished it redirects to a page i dont want it to redirect. Seems like the redirection … | |
Eleven parents in the US state of Pennsylvania are taking their local school board to court in an attempt to protect the teaching of evolution. [URL=http://news.bbc.co.uk/2/hi/americas/4282692.stm]BBC News[/URL] | |
Re: The war was an unjustified one in the first place. The US policy is not driven by an urge to "HELP other countries" but based on their own interest. This incident is just a fraction of things the US is suffering and will be suffering as a consequence of this … | |
Re: Nice topic :). I might want to do it sometime, just for fun though. I usually write down the topics and sub-topics discussed in the lecture and other subtle points, and then I study on my own. I wonder if the lecturer would be comfortable if he sees your recording … | |
Re: People demand freedom of speech as a compensation for the freedom of thought which they seldom use. ~Soren Kierkegaard | |
Hey dudes, I need to know the name of this jars. One of my friends told me they are ziraf jars. I did some amazon and ebay searches but couldnt find anything. I need to know the real name and where they can be found. My uncle got an order … | |
Re: [QUOTE]Bangladesh actually bet Australia buddy.I was an Australian cricket fan but they became too tough to beat,it was rather boring.[/QUOTE] Yup, the whole country celebrated the day Bangladesh beat Australia. | |
Re: Calculus Book (Anton, Bivens, Davis) Digital Design Book(Morris Mano) The C programming Language ( K & R) A Book on C (Al-Kelley, Ira Pohl) Physics Book A pencil Papers An Eraser My legs (counts as two) :P | |
[CODE] string s; getline(ifile, s, '\n'); stringstream parser(s); string temp; while(parser>>temp) variables.push_back(temp); getline(ifile, s, '\n'); while(parser>>temp) terminals.push_back(temp);//Doesn't work the second time. [/CODE] stringstream can tokenize the string s only for the first time. The string s is passed to it through the constructor. How can reinitialize the stringstream object? | |
Re: HO mama!!! How bout China? What's happening there? | |
Re: I edited your code, good for tc only... [CODE]# include <iostream.h> # include <conio.h> void main() { clrscr(); char address[60]; cout<<"Enter your address"; cin.getline(address,60,'\n'); cout<<"Your address is "<<address; getch(); }[/CODE] | |
Re: My learning started with turbo C++ 3.0. Infact, in my uni everyone starts from turbo C, C++. Only later they move to vc++ or dev C++. I think learning TC was just a waste of my time, since it's downright obsolete. You will be learning habits that u must unlearn … | |
Hi there everyone, Please fill up this questionnaire to help me in my research. It is regarding evolution and religion. I hope to get very good co-operation from you guyz. The questionnaire is [URL=http://www.thesistools.com/webform/index.php?formID=395]Here[/URL] Thank you. | |
Re: IMHO separating C from C++ is not necessary. Now I basically visit only C/C++ forum here in daniweb, then I have to visit two separate forums. Although It's not much of a problem, but I prefer C and C++ to be in the same forum. Even though C++ is covers … ![]() | |
Re: My first post in Web Development section. You just took the word out of my heart man, I would really love to know how to build a bloggy forum. Me and some of my friends have been using a team blog for a while, but much is still desired. | |
Re: First you need to have the right compiler(Old Turbo C++ 3.0?) for the code to compile. | |
Can anyone tell me if there's any standard package for C++ to work with regular expression, or I will have to get some third-party package? | |
Re: Just showing you how to extract digits one by one from an int [CODE] #include<stdio.h> int main() { unsigned input, temp; printf("\nEnter int: "); scanf("%u",&input); temp = input; do { printf("%i\n",(temp % 10)); }while((temp = temp/10) > 0); }[/CODE] And how to combine the digits stored in a string into … | |
Re: Looking forward to this. | |
I have a template linked list class, eg: [CODE]LinkedList<int> list1; LinkedList<implicant> list_imp;[/CODE] Now I need a Linked List of Linked Lists, This is how I declared [CODE]LinkedList<LinkedList<implicant> > list_of_lists;[/CODE] Then I declared a Linked List of implicant class. [CODE]LinkedList<implicant> implicants_list;[/CODE] I calculated some value and put them in the implicants_list. … | |
Re: [QUOTE]Write a function wich can be declarered as the following: unsigned int datecode(int year, int month, int day); The task of this function is to encode the given date into the 16 bits(the 16 right bits) of the unsigned int and deliver that as a function value. From left to … | |
Re: My experience in the world of programming is very short. However, I think every recursive function can be transformed into an iterative version. But often recursive functions are easily understood(not for all though :D) and makes the code shorter. So unless you worry too much (and I mean too much) … | |
Re: I mainly use a fastmail.fm account, they dont have any adds. The storage is only 10 mb, which is not much but is enough for me. One thing i like about gmail is its auto forwarding service, no other free email service lets you do that. | |
I want to make a program that will start off by opening a text file(blank). The user will put an expression in the file and as he hits the enter(enters a newline character) the result will be shown in the next line of the same open file. Itz almost like … | |
Re: I experienced CRC errors a number of times too. I heard that it's a kind of algorithm that checks whether the data read from a media is actually read correctly or not(i.e if there is any missing bits). I saw this error message while copying files from floppy disks. But … | |
I have to write a program where the input is a Boolean Expression and the ouput is the corresponding sum of minterms for that particular expression. My idea is that i need to convert the infix boolean expression to a postfix expression. From there I need to construct the truth-table … | |
Re: Hey I have this question about header files. Suppose i have myclass.h where the class structure is defined. And then I have a myclass.cpp where methods are defined. The myclass.cpp includes the myclass.h file. Now say i need to use the myclass in another file. Should I include myclass.h or … | |
After having us write codes to convert decimal numbers to another base my faculty has now asked me to write codes to convert a number from ANY base to another. He explains that itz simple since i already wrote the program to convert integer to another base. So i just … | |
Re: [QUOTE=chound]Just to attract your attention. :cheesy: :lol: :cool: ;) Here's the problem: I have this string "flames". Then I get a number from earlier part of myprogram. Let the number be 4. Now 'm' is the 4th character. This should be removed. Then the remaining string is "flaes". Now 'e … | |
Re: [QUOTE=prog-bman]You don't define your function in headers because headers don't get compiled. Make a seperate file for your rational or define them in your main file(I wouldn't do this).[/QUOTE] What are you talking about? U can define functions in headers if u want to. Now if it's a good practice … | |
Re: There is no need to be so harsh on intel, he is just starting out. He should have his freedom of speech and all these hostile responses wont make that easy. | |
Re: Ha ha! There are so many ways to do it. The easiest process is to try divide the number with every number less than (or half of it) and see if it has the remainder 0. If it does then check if the number u r dividing with is a … | |
Re: [QUOTE=Narue]>but why this sample program doesn't work??!! Integer literals are just that, integers. If you want a long literal, suffix it with L. If you want an unsigned long literal, suffix it with UL. [/QUOTE] if the integer cannot be held in int then the compiler will automatically make it … | |
I have written this program to convert a decimal number to a number of any base. The resulting number has been put into an array and so can be of any size. But the decimal number that i take as input is limited by the range of int. What i … | |
Re: C++ out, java in???????????? I see Bjarne Stroustrup(hope i get the spelling correct) burning in jeolousy.:p But, it's actually hard to believe...;) And I would like to add something from Stroustrup's website too....about c++ emerging with its new look... [QUOTE] [b]What will C++0x look like?[/b] I don't know. C++0x will … |
The End.