429 Posted Topics
Re: They are declared in the parameter list so that you can pass address to the function. if you declare them as local variables inside the function how will you pass the address of the variables to that function? mainly it depends on the requirement where and how you use pointers. | |
Re: 1> Please use 'code tags', do you see the 'Help with code Tags' on the right hand corner of your code? click that and read. 2>print_reverse definition should be preceded by scope resolution operator. 3>I don't see anywhere where you are writing the output to outstream? please make these changes … | |
Re: is this file present in the Test directory? can you post the include statement or the .h file if possible? | |
Re: [quote]incode.open(" C:\\Dev-Cpp\\inventory.txt");[/quote] is that space between " and C: there in the original code also? you can remove that space and try. | |
Re: Please dont start 2 threads for the same problem. did you read the comments that were posted in the other thread? [URL="http://www.daniweb.com/forums/thread159012.html"]http://www.daniweb.com/forums/thread159012.html[/URL] | |
Re: i think it should be [code]int calculation(l *w);[/code] and the other function seems alright. | |
Re: Dont use 'eof' as an exit indicator for the loop. eof() is true only after the end of file is read and not when end of file is reached as a result your getting one extra character. use while(file.getline(<args>)) instead of 'eof'. | |
Hi guys.. I'm facing a problem in my project. Basically its a small project for a retail store inbound section. The goods come in cartons and the user enters the carton ID in the UI to accept the carton. In the backend the carton details get updated in the table … | |
Re: shouldnt you be deleting the memory allocated inside the ctor? That's a memory leak. | |
Re: 1> Destructor does the cleaning up once the object goes out of scope. it doesnt have a return type, has the same name as the class name but preceded by a '~' . like your assignment alreasy says '~Point( )', defined has [code] Point::~Point( ) { //dtor } [/code] just … | |
i posted this in geeks lounge, got no response, so posting it here... Hi Guys... Anyone can share which are the top universities in UK for a Masters in Software Engineering and related fields? And how are they, compared to the top Univs in US and Canada? | |
Re: Please use 'Code Tags' for posting code to your qs. you will need one more loop, something like [code=cplusplus] for(int row_A=0; row_A<num; row_A++) { for(int row_B=0;row_B<=row_A;row_B++) { cout << ch; } cout << "\n"; } [/code] | |
Re: [QUOTE=Se7Olutionyg;708607]i got it, but can you explain me the difference between float computeGross (float, float); float computeNet (float money); thansk[/QUOTE] First of all you need to use code-tags always .. Nobody will even look at your code if its not easy to read, so without going through your code i'll … | |
Hi Guys... Anyone can share which are the top universities in UK for a Masters in Software Engineering and related fields? And how are they, compared to the top Univs in US and Canada? | |
Re: whats the type of 'ItemType' ? can you post the declaration. | |
Re: There are a lot of such examples here on daniweb, mostly using the 'while' loop. you can try and search for it in here... something like char y = 'Y'; while(y == 'Y' || y == 'y') { // some code cout << "Do you want to continue?"; cin >> … | |
Re: or you could do something like ... [code]int* arr = new int[rows * cols];[/code] then go on adding elements to it ... | |
Re: While loop is obviously not the right choice here .. whatever grade you enter will satisfy the condition always and the loop becomes infinite... just a simple 'if' should do i think if its to happen only once. or else you can use a 'yes'-'no' sort of menu. | |
Re: [code] if(!Continue()) { cout << "bye" <<endl; } [/code] is this what you want? | |
Re: you could do just like you're doing in the first part 1> ask the user if he wants to search by 1) firstName 2) LastName using a cout, you can create this menu 2> Then based on the menu option selected, search the array something like void getperson(person holdspeople[maxpeople], int … | |
Re: A math grad student at Rutgers [[URL="http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html"]http://recursed.blogspot.com/2008/07/rutgers-graduate-student-finds-new.html[/URL]] has come up with a formula which can generate infinite primes Let a(1) = 7 Define: a(n) = a(n-1) + gcd(n,a(n-1)) Then the prime generator is : a(n) - a(n-1) [one needs to ignore the 1s and then ignore the repeated primes] Ain't … | |
Hi, The same code as my previous post, but because of this list thing, i'm not able to run specific commands for different options. Here i have 2 options under the 'Names' Menu, 'rajat','prasun', now when the user selects either of them i should be able to know which one … | |
Hi, Below is my test code, i have a list of names in a file, i read the names and i have to insert them as menu options in the menubar. Since its a dynamic menu and people can add new menu's it has to be read from a file … | |
| |
Re: Its working correctly for me .. output: What is the number : 10 The nodes contain the numbers: 10 --> NULL What is the number : 2 The nodes contain the numbers: 2 -->10 --> NULL What is the number : 15 The nodes contain the numbers: 2 -->10 -->15 … | |
Re: and you need a default constructor of the class too, since you have declared your own ctor the compiler will not generate it for you... | |
Re: you can find loads of examples-definitions on google.. go through them.. then when you have more specific doubts ppl here can help .. happy learning :) | |
Re: simply use the 'c_str' function of the string class to convert to c-style string. | |
Re: [CODE]fstream openfile; openfile("my_file.txt"); if(openfile.fail()) { cout<<"Error opening file."; } else { mainprog(); }[/CODE] i'm surprised that this doesn't give you a compilation error. when i compile it i get a straight forward error fileopenDan.cpp(9) : error C2064: term does not evaluate to a function and the both the forms work … | |
Hi Guys, i just wrote a program to print a sentence backwards using recursion. But i'm not too happy about it, if someone can give me a more optimized solution i'll be glad. You have to use std::string class. input: where the streets have no name output: name no have … | |
Re: you could add one more field to the structure which specifies the 'member_type' and write that to your file then when you load the file based on the 'member_type' you can create the correct object type. | |
Re: for pointers you access the class members using '->' hence the line should be [code]int i = Human->getHealth();[/code] see the error carefully [quote]left of '.getHealth' must have class/struct/union [/quote] if its a class/struct/union you can use '.' | |
Re: or else you can use an array of FILE* if you want to use them elsewhere in the program. or write a structure with elements as FILE* and filename and use an array of that structure. | |
Re: [quote]what i have to put in the fopen? [/quote] i think you need a '/' something line "e:/reservat.txt" This is more of a C code though and please read about 'code-tags'. | |
Re: Hi, This code is too difficult to read. Can you please post a well formatted-indented code with code type specified as c++? and also post the entire code including the 'main'. I tried going through this but its just giving me a headache. | |
Re: yes you need to make it multi-threaded. Everytime the user clicks on the button it can spawn a new thread which does the work and the button is free for input. i think this code should help you [code=python] from Tkinter import * import threading import time class process(threading.Thread): def … | |
Hi, has anyone used the mdb debugger in solaris? I need to debug a core file on a client Machine which has neither dbx nor gdb. i could only find mdb, unfortunately i've never used mdb and it's kind of tricky. i dont know if people still use it these … | |
This is my code for a chat client. I create a simple UI with a text box for viewing the chat and an entry widget to write messages. There's a button called 'Connect', when i click this i start a new thread which does the connection and keeps receiving messages … | |
Re: you're trying to 'cout' the return value of some method, but the method might be returning 'void'. | |
Re: It all boils down to understanding how arrays are stored in memory and how we access each element of an array. arrays are stored sequentially in memory. So lets say you declare and array of 5 integers int arr[5]; in memory you can imagine it to be 5 cells allocated … | |
Re: what is this? what do you want us to do with this? I'm pretty sure this doesn't work. | |
Re: >I want it to be infinite, if possible Do you have infinite storage capacity? | |
Re: Though i'd like to believe otherwise but i think he's right to a large extent. Even in my own company they are porting the entire product from c++ to java and we have been asked to decide weather we'd like to move to Java or stay in c++ for supporting … | |
Hi Guys.. I need to know how to debug the 'main' of an exe using dbx. i cant put a 'sleep' and recompile it. For example in windows using visual .Net i can do something like >devenv /debugexe xyz.exe This will bring up the exe in debugmode. i need the … | |
Hi Guys... i'm sure the topic has given you a braod hint and if u've still been brave enough to open this just help me out... i have a dual boot system, windows XP and Ubuntu 7.1. i need to change this setup to a virtual machine setup, host xp … | |
Re: You need to give more info dude. As far as usage is concerned just look into any python tutorial on WWW | |
[code=c++] #include <iostream> using namespace std; class Lock { friend class First; private: Lock() { } }; class First : virtual public Lock { public: void function() { cout << "function1" << endl; } }; class Second: public First { public: void function2() { cout << "function2" << endl; } … |
The End.