51,593 Topics

Member Avatar for
Member Avatar for pdk123

Hello, Is the endianess can be for the nibble boundaries ? Because i have defined a class, and try to access the array with a pointer of class type. typedef unsigned char uint8; class A{ public: uint8 a:4; uint8 b:4; }; int _tmain(int argc, _TCHAR* argv[]) { uint8 temp = …

Member Avatar for pdk123
0
142
Member Avatar for Kanoisa

Hi everyone. Today i have been playing with templates and decided to make a generic question and answer function using templates to allow you to choose the return type for each call. Code below. [code] template< class T > T qAndA(const std::string Question,const T retType) { T retVar; std::cout<<Question<<std::endl; //ask …

Member Avatar for mike_2000_17
0
145
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
189
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
165
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
104
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
125
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
152
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
87
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
258
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
202
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
174
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
110
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
148
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
119
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
125
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
169
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
244
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
91
Member Avatar for DemiSheep

I have never programmed in C and have not programmed in C++ for a little while and either way, I am still learning. I am writing a program in C and am converting a MATLAB program to this C program. I have a lot of variables from MATLAB that are …

Member Avatar for Ancient Dragon
0
129
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
108
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
130
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
145
Member Avatar for anitha10

i hava retrieve the data from database to text box but i am getting only one row from the table i want to retrieve all the rows of a table in the text boxes how it is possible please help me sir.

Member Avatar for taylby
0
118
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
995
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
350
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
126
Member Avatar for Usmaan

Hi Folks, I'm making a Calculator on Visual Studio (Nope, it's not a College or University assignment). I'm at the part where I have added code to all of the number buttons but now need to see how the program is going to calculate sums of x amount of numbers. …

Member Avatar for Geekitygeek
0
199
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
133
Member Avatar for Rez11

I am trying to replace "the" with "that". My original sentence is "the ball is under the car". I can successfully change the first "the". But when I try to change the second "the" string1 ends up being "that ball us under that".So it cuts off the world "car". What …

Member Avatar for StuXYZ
0
204
Member Avatar for Vani3863

Hi All, I'm a relative newbie having trouble completing a program that is required to read the text character by character from a .txt file and to then encode certain characters to something thing else. It is then supposed to be output to a separate .txt What seems to happen …

Member Avatar for Vani3863
0
162
Member Avatar for tehmarto

Hi all, I have a program that loads a dll, uses it for some time and then it unloads it. I have no idea where dll is located or from where it is loaded but I know where dll is unloaded. Loading of the dll is very hardcoded and I …

Member Avatar for tehmarto
0
133
Member Avatar for effizy

I am new to C++ or any form of programming language. Would appreciate any practical tips on: - approaching problems - techniques on writing codes - rule of thumb for writing codes - fixing errors - how to define and use(call) functions - loop - array - float, double - …

Member Avatar for Jackk123
0
140
Member Avatar for xiansen

i am supposed which accepts a five-digit integer value. my program is then to output the digits, one per line. Each line of output should contain the digit value, its square and its cube. Once I have the program running correctly, modify the program so that it will process as …

Member Avatar for xiansen
0
296
Member Avatar for ticktock

Hey all, I am trying desperately to create a cube using VBO. I have the correct vertices that must be used yet when I render it, it only displays one part of the face of the cube (which in this case is a half triangle, since a square is made …

Member Avatar for ticktock
0
2K
Member Avatar for neural_jam

<edit>(scroll down a bit to avoid some rambling and get to the main question!)</edit> Hi there, I'm trying to write a C++ program that repeatedly executes another program (with a system call) that creates a file called 'output', then copies the output into a subdirectory and renames it so that …

Member Avatar for neural_jam
0
168
Member Avatar for y2kshane
Member Avatar for Stefano Mtangoo
0
156
Member Avatar for embooglement

I'm trying to write a to string function that would use std::stringstream to convert the the instance data into a string, but haven't been able to get operator overloading to work with it. As soon as I define a new << operator, I get a bunch of ambiguity errors saying …

Member Avatar for embooglement
0
2K
Member Avatar for low_coder

hey, im making a database program using standard c functions (fopen, fclose...) and i need to read and write data to files quite frequently, so is it better to open (fopen) and close (fclose) the files before and after each operation or open the files at the beginning of the …

Member Avatar for low_coder
0
99
Member Avatar for aikiart

Good day, I've got a question about why program 19-3 won't display a returning message but program 19-2 will. THIS IS 19-2 // This program demonstrates a simple recursive function. #include <iostream> using namespace std; // Function prototype void message(int); int main() { message(5); return 0; } //************************************************************ // Definition …

Member Avatar for aikiart
0
295
Member Avatar for abysss

I am new to thread programming,i basically want to learn how write threads in c++.It would be a great help to me if anyone could guide me through this or provide any tutorial links. thanks in advance sidharth

Member Avatar for abysss
0
145
Member Avatar for pdk123

Hi , Sorry for this basic question, i am stuck, with somethings, I have a class class A{ int * mem_ptr; } then somewhere in the code: if ( mem_ptr == NULL ) { mem_ptr = new int; } Is it safe to assume that mem_ptr is NULL when the …

Member Avatar for wtf4096
0
149
Member Avatar for jonymanolo

i have a big code in c++ and i need do a little change i have the src but when i do a change in the .sln file an try to compile again send me errors about the dlls and other stuff what i need to do? the change i …

Member Avatar for yusuf0024
0
62
Member Avatar for RayvenHawk

Ok I'm working on a DirectX project for an augmentation class and have a quick question. I'm needing to recognize a key being pressed (for example "s) which triggers action (x). I then need to press "s" again to then revert back to the original state. Currently I have an …

Member Avatar for Fbody
0
199

The End.