49,757 Topics

Member Avatar for
Member Avatar for sravya reddy
Member Avatar for lewashby

Can anyone tell me whay the following funtion that should be returning true if the year is leap year and false if it is not, is givign me unexpected results? when I entered 1985 I got true? when I entered 2012 I got false. When I entered 2000 I got …

Member Avatar for lewashby
0
193
Member Avatar for Hopp3r

So I was asked to write some simple functions that would search through an array of length (s) and tell how many times an (integer, double etc. ) appeared within the array. It's pretty simple because they give you the length of the array. However one of the functions doesn't …

Member Avatar for NathanOliver
0
2K
Member Avatar for angel.heaven.58367

I am trying to do a C++ coding. I am trying to do problem in which i have numbers of points. Now i need to find the path that goes through all the points. This is not actually TSP because as per my knowledge in TSP it is possible to …

Member Avatar for sarathy333
0
91
Member Avatar for on93

can anyone help me to fix this problem ? i can delete the midder and the tail of the node , the only problem is i cannot delete the head node when i have more than one node. ---------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ …

Member Avatar for on93
0
329
Member Avatar for babuliy

i wanna know ina easy way what do we ,mean by inheritance and hybrid inheritance in c++

Member Avatar for CGSMCMLXXV
0
134
Member Avatar for finders

Hey, I have never programmed before, so everything is very confusing for me. I was given an assignment to change binary to a decimal number. Not very much information was given to me. I am NOT looking for an answer, but I definitely am looking for some help as to …

Member Avatar for CGSMCMLXXV
0
799
Member Avatar for kchat

Hi guys, trying to figure out why i can't insert this LinkList i create (TrainA) can't be placed into the Queue. I keep getting the error 'trainA' was not declared within this scope. Any help will be cool thanks! class Link { public: int iData; // data item (key) double …

Member Avatar for Lucaci Andrew
0
207
Member Avatar for black_box

A solution for the "Hartals" problem. Problem description: http://icpcres.ecs.baylor.edu/onlinejudge/external/100/10050.html Author: [Joana Matos Fonseca da Trindade](http://joanatrindade.wikidot.com) #include<stdio.h> int main() { int i,j,k,a,b,h,hd[100000],n,p,pd[150],tc,t,s; while(scanf("%d",&tc)==1) { for(i=0;i<tc;i++) { h=0; s=0; scanf("%d",&n); scanf("%d",&p); for(j=0;j<p;j++) scanf("%d",&pd[j]); for(j=0;j<p;j++) for(k=pd[j];k<=n;k+=pd[j]) if(k%7!=0 && k%7!=6) { h++; hd[h-1]=k; } for(a=1;a<h;a++) for(b=h-1;b>=a;b--) if(hd[b-1]>hd[b]) { t=hd[b-1]; hd[b-1]=hd[b]; hd[b]=t; } for(t=1;t<h;t++) if(hd[t]==hd[t-1]) …

0
102
Member Avatar for on93

can anyone help me to slove the problem ?? i wan to delete a node either form the head , midder or last , then print out all the node . #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; …

Member Avatar for on93
0
170
Member Avatar for mattster

Right everyone, here's my problem. I have just paid £45 for a book on Qt, have had a nightmere getting it sorted, and finally I can build apps to this extent... I have an app, *test.pro*. I have built it using `qmake test.pro` -> `make` which works. I am using …

Member Avatar for mattster
0
288
Member Avatar for Doogledude123

Im reading a text file and storing the characters in an array. I get a "Unhandled exception at 0x0109985e in Executable.exe: 0xC0000005: Access violation writing location 0xcccccccc." void drawMap(string MapLoc) { int i = 0; int x = 0; int y = 0; char* arrayMap[5225]; ifstream mapReader; mapReader.open(MapLoc); for (i …

Member Avatar for Doogledude123
0
281
Member Avatar for myk45

Hello All, i have a small question regarding casts in C++. 1) Now, dynamic_casts ensure safety with casts. ie. for example: for the below polymorphic class: class Base { public: virtual void foo() {} }; class Derived : public Base { }; int main() { Base *bPtr = new Base; …

Member Avatar for myk45
0
581
Member Avatar for n@nnouss@

I have a project and a part of it is related to sha 1 encryption using openMP. Any help would be highly appreciated.

Member Avatar for n@nnouss@
0
646
Member Avatar for pivren

consider the following program #include<iostream.h> #include<fstream.h> void main() { int no; ifstream fin; ofstream fout; fout.open("create,dat",ios::app); fout<<"What is your fav. number"; fin>>no; fout<<no; fout.close(); } NOW HERE IS THE PROBLEM WHILE THE PROGRAM IS RUNNING PERFECTLY AND THE NUMBER IS BEING STORED IN A .DAT FILE BUT THE NUMBER IS …

Member Avatar for mrnutty
0
329
Member Avatar for Asmaa_2

I'm asked to write a program in which the user inputs a letter and the program converts it to lower case if it's UPPER and vis versa. I have written this program and it worked: #include<iostream> using namespace std; int main() { char letter; cout<<"Enter any letter"<<endl; cin>>letter; if(letter>=97&&letter<=122) { …

Member Avatar for MandrewP
0
495
Member Avatar for Elixir42

Hi I am allocating memory space and adding nodes like this: CSprite* pNewSprite = new CSprite; // Create new sprite pNewSprite->iData = iChoice; // Attach data EnemyList->AddNode(pNewSprite); // Send to AddNode and also in the ::AddNode: void CLinkedList::AddNode(VOID* pData) { CNode* pNewNode = new CNode; // Create the Node pNewNode->pData …

Member Avatar for Elixir42
0
235
Member Avatar for robbie.dunham.50

Hi I am new to programing and I want to learn some basic tings. I also want to learn to create basic games. Could anyone reccomend a good book or websiteto get me started? Thanks, Robbie

Member Avatar for PixelDown
1
198
Member Avatar for erkanay

hi ! how can i do a one-way-circular linked list function that gives to me** merge 3 lists** such as struct node{ int data; node *flink; node *blink; }; void concatenate(node *&L1,node *L2,node *L3) { ??? }

Member Avatar for erkanay
0
170
Member Avatar for on93

can anyone help me to solve this problem ? i cannot excute this program. ----------------------------------------------------------- #include<iostream> #include<string> using namespace std; class linklist { private: struct node{ struct student{ string name; int id; string prog; double cgpa; }st; node *link; }*head; public: void linklist_1(); void linklist_2(); void insFirstNode (string name, int …

Member Avatar for Lucaci Andrew
0
124
Member Avatar for ziadkassam

Hello all... My project is to parallelize the MD5 program using OpenMP (omp). so please help... This is test.cpp: #include <stdio.h> #include <omp.h> #include <iostream> using namespace std; #include "md5.h" int main(void) { int n; double time1, time2; time1=omp_get_wtime(); cout << "\n The MD5 of 'zzzzzz' is : "; cout …

Member Avatar for ziadkassam
0
487
Member Avatar for northrox

the loop runs infinte for the second ittiration //attempt two to make the student data base the other way // this program runs onlu once and does not hav any data base once u exit #include<iostream> #include<conio.h> using std::cout; using std::endl; using std::cin; int count=0; class student { double m_roll[100],m_class[100]; …

Member Avatar for Lucaci Andrew
0
213
Member Avatar for Suzie999

I'm trying to be clear about registry, and would hope someone might confirm, or not, that my interpretation is correct. I read [here](http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724072(v=vs.85).aspx) > The parent of each 64-bit registry node is the Image-Specific Node or ISN. The registry redirector transparently directs an application's registry access to the appropriate ISN …

Member Avatar for Ancient Dragon
0
154
Member Avatar for lewashby

In code like int `main(int argc, char **argv)`, I'M trying to understand command line arguments a little better. And what would be the difference between `char ** argv` & `char * arg[]`? Thanks.

Member Avatar for Lerner
0
127
Member Avatar for brock.holman.7

so i am on my last 2 programs for my programminng course and i only have till monday(3 days) to do both of them here are the guidlines for the first project: 14-1 Write a program that declares an array of ten floating point values. Have the program prompt the …

Member Avatar for Lerner
0
109
Member Avatar for saraaw

An integer double-dimensional array called hotel is used to keep track of reservations in an hotel of 5 floors each floor having 8 rooms. The floors are numbered 1, 2, 3, 4, and 5, and the rooms are numbered 1, 2, 3… 8. Write a C++ program to manage the …

Member Avatar for Doogledude123
0
350
Member Avatar for Suzie999

Hi, I'm trying to create a *link like* label in a win32 application. VS2010 I generally find an API I can use but I'm having no luck with it currently. Just wondering if anyone has some Ideas? just a starting point will be great. Appreciate you reading, thanks.

Member Avatar for Suzie999
0
194
Member Avatar for herge

Hi Everbody: To get rid of specific warning in 2008 vc++ or 2005 vc++ 1>c:\documents and settings\user\my documents\visual studio 2008\projects\gmt\gmt\gmt.cpp(25) : warning C4996: '_gmtime64': This function or variable may be unsafe. Consider using _gmtime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files\microsoft visual studio …

Member Avatar for deceptikon
0
229
Member Avatar for deceptikon

For those of you familiar with the latest C++ standard, what do you think of [uniform initialization](http://en.wikipedia.org/wiki/C%2B%2B11#Uniform_initialization)? Listening to folks like Herb Sutter, it seems like the intended purpose is to be completely pervasive, which obviously changes the look and feel of C++. Do you plan on using it everywhere …

Member Avatar for vijayan121
0
417
Member Avatar for Honeymaid

[LEFT]okay, I've got a connect four, 2 player, console game due today, and I've got everything pegged down except for checking for a win, I've tried multiple things, ifs, whiles, fors, and I only have around 5 weeks of experience in C++, with around 15 hrs of class every week. …

Member Avatar for Choro
0
2K

The End.