51,592 Topics

Member Avatar for
Member Avatar for vikuseth

double & val = 66.6; //illegal const double & val = 66.6; //legal I was just doing some demo programs and came through the above concept but not able to identify what exactly the need of the above concept . what magic exactly const is doing in the second case …

Member Avatar for Gonbe
0
232
Member Avatar for myk45

Hello All, I was doing some multi-threaded programming using the new C++11. This thought came across my mind: Is there any problem if some shared data is accessed by multiple cores on a CPU? Even if it is just a read. Does this lead to some problem? Could anyone please …

Member Avatar for mike_2000_17
0
232
Member Avatar for amt_muk

Hello, Can you please suggest me some 3rd party C++ libraries like RogueWave SourcePro C++. Thanks in advance, Amit M.

Member Avatar for mike_2000_17
0
266
Member Avatar for Zaina jee

I have to write a program that will input a text paragraph from the user. The maximum size of the string will be 500.I have to write a program in which if user select 'R' or 'r' then user is asked to enter a word he wants to replace and …

Member Avatar for Zaina jee
0
2K
Member Avatar for tapananand

I Just wanna know what happens if we try to do the following in C++: `"abc"+'d'` i.e what happens if we concatenate a character to a C-string.

Member Avatar for deceptikon
0
777
Member Avatar for efe.ozyer

Hi every body, i want to get a data from List<T> so; class Npc : IDisposable { public short id; public float fX; public float fZ; public float fY; } internal List<Npc> m_arNpcArray = new List<Npc>(); I want to get data like this; m_arNpcArray.GetData(int id); GetData() { for(int i = …

Member Avatar for efe.ozyer
0
411
Member Avatar for Karlwakim

Hi, I've been learning c++ for a few months on a windows os. (Not using the API) And im building a new computer soon. I will install Backtrack at first, then win if I need it. My goal is to become a professional developer (I will most likely write code …

Member Avatar for Karlwakim
0
265
Member Avatar for putri MSR

## **sorting (array) c++ who user can enter numbers from output.** ## #include <iostream> using namespace std; void enternumber (int *array, int N); void bubblesort (int *array, int N, int Order); void selectionsort (int *array, int N, int Order); void insertionsort (int *array, int N, int Order); void quicksort (int …

Member Avatar for vmanes
0
504
Member Avatar for mjbor1

i have problem in convert infix to postfix some expression evaluate it correctly and other no ex: c\*(a+b) evaluate it correctly but A\*(B\*C+D)+E doesn't evaluate correctly and there is another problem in finding result my code // convert.h const char SIZE=100; class stack { public: stack(); bool isempty()const; bool isfull()const; …

Member Avatar for mjbor1
0
378
Member Avatar for vinay.negi

hey.... i want a project on computer shop........ could u can plzzz,,,,,,,,,,,......

Member Avatar for PrimePackster
-1
189
Member Avatar for fize.tesfay

i need c++ code for simple linked list to implement algorith and data structure 1.create_node_and add to list 2.frst node delete 3.last node delete 4.delete node between first and last node 5. displaye the value of node in revese order 6. searching 7.exist

Member Avatar for fize.tesfay
0
339
Member Avatar for new_developer

Does any buddy tell me use of asterik in C++ ?? And also explain use of static in methods and in constructors. Actually I am search a code that dynamically creates an object of class. Anyone please help ! class BoxFactory { public: static Box *newBox(const std::string &description) //expalin this …

Member Avatar for ravenous
0
254
Member Avatar for triumphost

This may be a long post but I really need to know how to Convert between the two image formats and amonst themselves as well. Here goes: I have a struct like the one below that holds all pixel information: typedef union RGB { uint32_t Color; struct { unsigned char …

0
339
Member Avatar for Kareem Klas

Dear members I'm wondering about what would be a good book to study C++ game programming. I have a pdf of Beginning C++ game programming by Michael Dawson. Now I want to buy one, but I don't know if there is an better one than this one. Kareem Klas

Member Avatar for <M/>
0
325
Member Avatar for tomz6

Why do some people put main(int argc, char ** argv) not main() ? What's the difference? When is it needed? Thanks in advance, Tom.

Member Avatar for ahmedhamdy
0
587
Member Avatar for owenransen

I'd like to create a video from a series of images in my MFC application. Is there an API or example source code which would get me started? I imagine I'd create an MP4 or AVI file. (A sub question: I've heard that Windows 7 includes the MP4 H.264 encode …

Member Avatar for Ancient Dragon
0
275
Member Avatar for kpele1

i am a computer science students and one of our project this christmas vacation is to create c++ programs and we will submit it on the 3rd of january but i dont have idea where can i find it anyone please could help me thanks...

Member Avatar for PrimePackster
0
180
Member Avatar for vishalonne

Hello I can't understand why 1st cin for Enter Name is skipped out of 3 cin statements in getData function in Teachers class other 2 cin statements are accepting input- Here is code - #include <iostream.h> #include <stdio.h> #include <conio.h> #include <string.h> class Teachers { private: char staff[20]; char post[20]; …

Member Avatar for vishalonne
0
147
Member Avatar for alessandro.panzeri.102

I need to know if there is a way with linux debugger gdb to detect if a function (any function) of a specific C++ class (represented by file Chord.cc) access a specific memory location (let's say 0xffffbc). That will help me a lot. Thanks.

Member Avatar for mike_2000_17
0
37
Member Avatar for vishalonne

Hello I am trying to pass a array of object to a member function of that class but not successfull. I gone throgh lots of article and document also follow this thread in Daniweb [Click Here](http://www.daniweb.com/software-development/cpp/threads/2771/passing-arrays-of-objects-to-functions) This thread is good to understand how to pass an array of object to …

Member Avatar for vishalonne
0
755
Member Avatar for KhubaibQaiser

Hi all! I am making a program to input a paragraph from the user and then finds/swap/delete/insert a word in that paragraph. I am stuck on the first stage. I have made a program that just returns the starting index of the searched word. But its case sensitive and i …

Member Avatar for deceptikon
0
261
Member Avatar for jason.louis.798

Does it matter what type of monitor you have if you want to get a sound input out of C++? I recently downloaded 2010 to be able to work on homework over break. We are doing a project with Beeps, and i transeferred my work to my computer. But when …

Member Avatar for deceptikon
0
90
Member Avatar for ihatehippies

I came across this project that could be really helpful.. if I was c++ literate. I know enough c++ to be dangerous and thats about it. Thanks in advance for anyone who wants to take a crack at it. ps credit to: http://www.codeproject.com/Articles/13839/How-to-Prepare-a-USB-Drive-for-Safe-Removal

Member Avatar for Gribouillis
0
265
Member Avatar for thePAkid

Write a C++ program that will display the following menu and word accordingly. A menu which contains functionality that will allow the following choices. 1. Enter the student data file name. 2. Display the average and the letter grade for each student. 3. Sort data from highest to lowest 4. …

Member Avatar for vmanes
0
245
Member Avatar for aslam.junaid786

#include "stdafx.h" #include<iostream> #include<conio.h> #include<string> using namespace std; //--------------------------------Structures--------------------------------// struct datee { int month; int days; int years; }; struct book { string bookname; string bookpublisher; string authorName; int copies; int price; int edition; datee date; }; //---------------------------Function Prototypes----------------------------// void titleheader(); void menu(); void addbook(book b[],int i); void display(book b[],int …

Member Avatar for john.w.austin.39
0
193
Member Avatar for vikuseth

Programe #1 inside file.h class File { public: static const int var = 9; }; inside main.cpp #include <iostream> #include "file.h" using namespace std; int main() { File f; cout << f.var; return 0; } Programe #2 inside file.h int Globalvar ; class File { public: static const int var …

Member Avatar for mike_2000_17
0
232
Member Avatar for aslam.junaid786

**CODE** #include "stdafx.h" #include<iostream> #include<conio.h> #include<string> #include<fstream> using namespace std; //---------------------------Function Prototypes----------------------------// void titleheader(); void menu(); void addbook(); void display(); //--------------------------Main Function---------------------------------// int _tmain(int argc, _TCHAR* argv[]) { int op; titleheader(); menu(); cout<<"\nPress option key to activate the required function: "; cin>>op; switch (op) { case 1: { system("cls"); titleheader(); …

Member Avatar for aslam.junaid786
0
928
Member Avatar for aslam.junaid786

CODE #include "stdafx.h" #include<iostream> #include<conio.h> #include<string> #include<fstream> using namespace std; //---------------------------Function Prototypes----------------------------// void titleheader(); void menu(); void addbook(); void display(); //--------------------------Main Function---------------------------------// int _tmain(int argc, _TCHAR* argv[]) { int op; titleheader(); menu(); cout<<"\nPress option key to activate the required function: "; cin>>op; switch (op) { case 1: { system("cls"); titleheader(); …

Member Avatar for aslam.junaid786
0
213
Member Avatar for dshiells

Hi all, I want to create a separate class in my C++ application which creates a dialog from a resource, similar to extending CDialog in MFC, however I would like to avoid using MFC. For example, I would like to be able to run the following code in my WinMain …

Member Avatar for dshiells
0
225
Member Avatar for iamthesgt

I have a class Client that is the main class for my Windows C++ application. Inside the client class, I have a number of variables and functions. One variable I'm having trouble with is the manager: private IRManager* manager; The main function of my class is int APIENTRY InnoVisitClient::_tWinMain(HINSTANCE hInstance, …

Member Avatar for theguitarist
0
529
Member Avatar for triumphost

I'm in a bit of a dilemma. I want to know what the difference is between Foo and Meh. I wrote both of them and I did not like Foo so I wrote Meh. They both work but is there an overhead to Meh? Is there anything bad about Meh? …

Member Avatar for mike_2000_17
0
228
Member Avatar for TheBrick

Hi, I'm not sure what forum to stick this in but seeing as the test was in C++ I thought I'd stick it here but feel free to move. I recently completed a test for a job application. I completed 2 out of the 3 questions (it was a choose …

Member Avatar for mike_2000_17
0
139
Member Avatar for CodyOebel

I am just researched out in frustration. No matter what I do I get an error trying to declare InternetOpen. [CODE] #include <WININET.h> #include <windows.h> int main() { /// Other includes were taken out to keep post small HINTERNET hInternet = InternetOpen( "TestApp", INTERNET_OPEN_TYPE_PROXY, "www.oebelknives.com",0, INTERNET_FLAG_ASYNC ); //HINTERNET FTPOpen = …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for peymankop

Hi! i'm a bit new in c++ so i'v got some question wish you to answer me...! first of all i want my program to show the specific group of line of my file so i use this code for it: using namespace std; int main() { ifstream myfile; myfile.open("test.txt"); …

Member Avatar for Lucaci Andrew
0
129
Member Avatar for anukavi

Hi, Before posting this question, i had gone thru related answers in many sites but cudnt get a solution to the problem. I have followed the step needed for Socket timeout, but the timeout eventually pass for the first time but fails for second time. Platform : VC++ 2012 MFC …

0
105
Member Avatar for myk45

Hello All, I was experimenting with creating a large number of threads and checking how fast it runs on my machine.(details provided later) This is the code i'm using: #include <iostream> #include <thread> #include <ctime> #define THREADED 1 static const int num_threads = 100; static int mult_array[100][1000000]; void multResult(int *arr) …

Member Avatar for myk45
0
740
Member Avatar for pjh-10

having trouble finding this anywhere, on a 32bit computer, how many bytes does it take to store ; long int, unsigned char,float, double any help is much appreciated

Member Avatar for vmanes
0
228
Member Avatar for James19142

I used `memcpy` to copy the contents of one pointer to another pointer assigned to new memory. Later in the program I get runtime errors as if I were attempting to operate on a pointer pointing to nothing. While debugging, I saw that the original and the the copied pointer …

Member Avatar for James19142
0
2K
Member Avatar for efe.ozyer

BYTE GetByte(char* sBuf, int& index) { int t_index = index; index++; return (BYTE)(*(sBuf+t_index)); } int GetShort(char* sBuf, int& index) { index += 2; return *(short*)(sBuf+index-2); } and i cannot convert this

Member Avatar for tinstaafl
0
477
Member Avatar for arjun.walmiki.1

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.IO; using System.Runtime.InteropServices; namespace PortDataReceived { class Program { static void Main(string[] args) { SerialPort mySerialPort = new SerialPort("COM1"); if (mySerialPort.IsOpen == true) mySerialPort.Close(); mySerialPort.BaudRate = 2400; mySerialPort.Parity = Parity.None; mySerialPort.StopBits = StopBits.One; mySerialPort.DataBits = 8; mySerialPort.Handshake = Handshake.None; …

Member Avatar for efe.ozyer
0
471
Member Avatar for xxwikkixx

Hey everyone just to refresh my memory and practice some programming I decided to make the dice program here is my code: #include <iostream> #include <ctime> using namespace std; int main() { int input; int random; cout << " VIRTUAL DICE 1.0" << endl; cout << "Enter 1 to roll …

Member Avatar for theguitarist
0
171
Member Avatar for gamnlxvi

#include <iostream> #include <stdlib.h> //For system() #include <conio.h> //For getche() #include <time.h> using namespace std; //You can modify these numbers but don't delete these constants or this starting code will not work const int MAX_HEIGHT = 20; //The height of the grid const int MAX_WIDTH = 40; //The width of …

Member Avatar for deceptikon
0
549
Member Avatar for karan.rks

hey... I'm coding a program for my school project and i have come across a very different problem!! I was using graphics.h in my program... everything is running great.. even graphics are doing well... but after some time... that is after some input... the size of the text shrinks... and …

Member Avatar for Ancient Dragon
0
371
Member Avatar for amit43

i want to know when we take the input using cin then what does '\n' and ' ' does. #include <iostream> #include <string> using namespace std; int main() { int x, y; string s; double a, b; cin >> x; cin >> y; cin >> s; cin >> a; cout …

Member Avatar for Lucaci Andrew
0
81
Member Avatar for Drekh

Hello I have made a little program in C#. I am writting it in notepad and compiling via command prompt. But when i start that program there is console window and I dont know how to hide it. Here is the code: [CODE]using System.Diagnostics; class Program { static void Main() …

Member Avatar for arjun.walmiki.1
0
14K
Member Avatar for gamnlxvi

#include <iostream> #include <stdlib.h> //For system() #include <conio.h> //For getche() #include <time.h> using namespace std; //You can modify these numbers but don't delete these constants or this starting code will not work const int MAX_HEIGHT = 20; //The height of the grid const int MAX_WIDTH = 40; //The width of …

Member Avatar for gamnlxvi
-1
213
Member Avatar for inneedofhelp123
Member Avatar for inneedofhelp123
Member Avatar for Knowledge72
1
232
Member Avatar for BirdaoGwra

Hi, This is prity basic question but I am a little stuck with it. I have a class with a member variable in it. There are three files, say a, b and c. in file b.cpp - class b { public: ----- ----- int i; } in file c.cpp - …

Member Avatar for BirdaoGwra
0
197
Member Avatar for opel123

hi :) is there a possible way where in we can combine two rows for an example i have this code: #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream outfile; outfile.open("1stRow.txt"); for(int i=1;i<10;i++) outfile<<i<<endl; outfile.close(); ofstream outfile2; outfile2.open("2ndRow.txt"); for(int j=2;j<11;j++) outfile2<<j<<endl; outfile2.close(); //return 0; } …

Member Avatar for opel123
0
240

The End.