49,761 Topics
| |
[CODE]int main() { int ival=12 , ival2 = 14; int &ref=ival; ref = ival2; cout<<ref; return 0; }[/CODE] That code shows an o/p as 14? How is it possible ? i thought references were not reassignable ? 1 more thing- do references occupy seperate spaces in memory like pointers ? … | |
Hi all, I got a idea! if you have open source project ideas please share them on this thread. There are many tons of open source projects out there in the internet. what here expected is fresher level complex code-bases. :TODO: requests are welcome. so the final year students who … | |
Hi guys, i am doing one accounting project. I use 3 binary files to store account holders information, login information and transaction. For mini-statement i need to read my Transaction binary file in backward. i dont know how to do ... My structure is [CODE] struct Transaction_Info { int AccountNumber; … | |
Float can hold 6 significant digits and double 10 (this is how the book tells me). Consider this code i wrote to test : [CODE]int main() { double a=355979.567; //9 significant digits i think cout<<a; return 0; }[/CODE] The o/p is 3555980. i thought since 'a' is double it should … | |
Hi and thanks for reading.I'm trying to acces the master PLC of a CAN network using the windows api.It's become a nuisance since i cant' figure this out at all.I will try to be brief since i don't have the source code at hand. So i'm initializing a handle for … | |
Hi experts! I have the following code which I use for dynamically creating objects in one module (executable or shared object (.so or .dll)) and be able to delete it from any other module while enforcing the call to the delete operator in the original module where the object was … | |
im trying to open a .mov file in binary which is easy enough to do... i haven't coded in a while... but i reread the book i had in school on the chapter on fstream.... i am instantiating an fstream obj with ios::binary to open a .mov file... i can … | |
I'm a little new to C++ templating, and I'm having trouble understanding this behaviour. Basically, I have a templated class, and I want to define the = operator between the class and the same class with any template parameter. The problem is that the overloaded version of the = operator … | |
I'm coding a dll which i am injecting into a target process. This dll patches some code to intercept some function calls before they happen, and i need to read whats in the registers and possibly modify them before i return. The EDX register for instance, will hold an address … | |
hi please help me....can you give me a code for queue program??? the flow look like this: KEY FUNCTION E Enqueue D Dequeue H Hide implementation S Show implementation R Bubble sort *note 10 numbers to be inputed. | |
Hi, I have abstract base class with some kids deriving from it. I want its kids to be concrete classes But I don't want to implement the all methods of the class. I'm trying to find a trick to go around doing this and I'm running out of thought on … | |
Hi all, Is it possible to call constructor and destructor explicitally? | |
Hi! Still being an absolute beginner, I can't find a reason for why this program doesn't run properly (note that the program is not complete). It is possible to compile it but it encounters some kind of error when executing. The string saves the file properly I have checked this … | |
i am trying to review what C++ stuff i have learned last year before high school starts, but the code i am writing does not run properly after i compile it. the code compiles the code does not execute. the code does not execute after Recruit() runs C_Name() to get … | |
| Hello there my second topic I need to write a function that writes 10 random numbers into a file. I came up to this point: [CODE]#include "stdafx.h" #include <iostream> #include <fstream> using namespace std; int main(){ ofstream outfile("C:\\Random"); //Random as in you can put any file you want for(int i … |
It is Object-Oriented Programming(c++). I have already done part2a and 2b, I need some ideas for the rest,it is really grateful if you could give me some ideas about that. THANKS!! The following is the project: 1. Task b. Identify the objects and classes to be used in the program. … | |
Hi All Can someone pls help me on this one. Under nested 'if' conditions inside 'case', i have 2 sections. If i choose to go to section 1 or 2, when i am done, how can i return back to the primary 'if'. Any help will be highly appreciated. This … | |
Hi Daniweb users, I am attempting to make a database in c++ by saving the information to a class and then saveing it to a file. but i dont know if that is a good way to do it. Here is a example picture of the database i am making … | |
Dear All, I'm trying to sort a list of structs using STL library. [CODE] struct myStruct { int i; string s; }; bool compare(int first, int second) { if (first < second) return true; else return false; } int main() { list<myStruct> myList; /* Pretend that myList has elements with … | |
[COLOR=#000000]:sad: My teacher is killing me, he just graduated from Yale, and he hasn't been teaching long that is very apparent. I don't know, but I think this has something to do with the complexity of his assignments for this, the first class you take for Computer Science, C++.[/COLOR] [COLOR=#000000]In … | |
I did exercise 2) of chapter 9 in Stroustrup's book. That chapter is about classes, its members, enumerations, constructors, etc. This is my first attempt at writing a program with classes containing public and private members that are both data variables and functions. It compiled and ran correctly,BUT. The exercise … | |
Good day, I'm having problems seeing how the recursion is working with this program. I've traced it but I don't understand why after if(num >0) is false it returns to the statement following the last function call and then seems to start the recursion again, but backwards? What I see … | |
Hi, I recently started learning C++ because i wan to develop games, anyway i just got to file i/o part and i got a problem with the binary file read. I created a class to test the binary file i/o: [code=c] #ifndef KAIZOKU_H #define KAIZOKU_H #include <string> #include <fstream> class … | |
Hi developers, i try to write a file in binary format. But that file is not in binary format, i dont know what's wrong in my code [CODE] #include <iostream> #include <fstream> using namespace std; int main() { fstream file("file path", ios_base::binary | ios_base::in); char buf[] = "BinaryFile"; file.write(buf, sizeof(buf)); … | |
I looked through other threads, but could not find on how one would be set up. So my question is, How would you set up a C++ text based game. | |
Hello everyone, Just wanted to know how can i blink a text in C/C++. Should use any graphics function. And i'm supposed to use a TC 3.0 :rolleyes: | |
i havae made circuit which we can operate from computer. i know c++ but hoe can we programme hardware using c++. any books or links or suggestion regarding to it please reply | |
Hi I have a problem with my c++ code which is compiled using turbo c++ on vista and the code is: [CODE]outtextxy(99,40,"f"); p=getch(); if(p==27) main(); else if(p=='f') void fig();[/CODE] error is: misplaced else in function i have tried changing to o[CODE]uttextxy(99,40,"f"); p=getch(); if(p==27){ main();} else if(p=='f') { void fig(); } … | |
hiya, i am new in C++ and need to create a windows form application that at the click of the button the class is called and excecuted. I have done GUI's in java and its no big issue for me, its just that I need the GUI in c++ since … |
The End.