49,761 Topics

Member Avatar for
Member Avatar for Kakashi Hatake

[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 ? …

Member Avatar for Narue
0
1K
Member Avatar for NicAx64

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 …

Member Avatar for mrnutty
0
187
Member Avatar for ganesh_IT

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; …

Member Avatar for Ancient Dragon
0
164
Member Avatar for Kakashi Hatake

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 …

Member Avatar for mike_2000_17
0
101
Member Avatar for caut_baia

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 …

Member Avatar for mike_2000_17
0
123
Member Avatar for mike_2000_17

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 …

1
150
Member Avatar for therstonsplace

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 …

Member Avatar for therstonsplace
0
85
Member Avatar for Mozza314

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 …

Member Avatar for mike_2000_17
0
253
Member Avatar for fireup6

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 …

0
72
Member Avatar for boyhenyo

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.

Member Avatar for polisure
0
199
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
130
Member Avatar for harris21
Member Avatar for John Sand

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 …

Member Avatar for John Sand
0
170
Member Avatar for totalwar235

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 …

Member Avatar for totalwar235
0
108
Member Avatar for Jackk123

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 …

Member Avatar for Jackk123
0
145
Member Avatar for cnmsg007

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. …

Member Avatar for Lerner
0
116
Member Avatar for newbie_to_cpp

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 …

Member Avatar for newbie_to_cpp
0
122
Member Avatar for Martje

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 …

Member Avatar for mike_2000_17
0
165
Member Avatar for group256

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 …

Member Avatar for mrnutty
0
5K
Member Avatar for Stony

[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 …

Member Avatar for dusktreader
0
238
Member Avatar for shashwat gupta
Member Avatar for Nathaniel10

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 …

Member Avatar for Nathaniel10
0
88
Member Avatar for aikiart

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 …

Member Avatar for aikiart
0
106
Member Avatar for mdl731

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 …

Member Avatar for mdl731
0
128
Member Avatar for ganesh_IT

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)); …

Member Avatar for Fbody
0
138
Member Avatar for JediMasterBane

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.

Member Avatar for PixelExchange
0
103
Member Avatar for stackOverflow

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:

Member Avatar for Nick Evan
-1
975
Member Avatar for hardikp.001

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

Member Avatar for mike_2000_17
0
313
Member Avatar for sashank.thags

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(); } …

Member Avatar for Nick Evan
0
125
Member Avatar for ragoo

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 …

Member Avatar for ragoo
0
130

The End.