1,076,524 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by a.muqeet khan

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

this is not merge sort i was just testing a theory of mine or rather trying to understand it through experiment .
All this programdoes it that it recursivly displays counting in desending form that its

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

hello guys ! i have created a program just to understand how to return a value from using a recursive program

what it does it thati have have two variable i.e first and last
the value of first is zero and last is 10

not i want the function to continue until last ==to first
if not it would simply return the value of the last and decrement here is the code and the prob listed and yes i am noob

#include<conio.h>
#include "stdafx.h"
#include <iostream>
# define size 10;
int mergesort(int,int);
using namespace std;



int _tmain(int argc, _TCHAR* argv[])
{
	int first=0,last=10;
	
	//cout <<" enter the vlaues";
	
	//for(int i=0;i<10;i++)
	//cin>>arr[i];
	cout<<mergesort(first,last);
	system("pause");
	system("pause");
	return 0;
}

int mergesort(int first,int last,int mid)
{ int a=34343434;
   cout<<"mergesort called";
    if(first==last)
    {
                cout<<"its the end of the world";
				
				return a;
	}
  
if(first=!last)

{last--;
 cout<<"\n"<<last;
 mergesort(first,last,mid);
 return last;
}
return first;
}

here is the prob and plz tell me how to over come it

1>------ Build started: Project: merge sort, Configuration: Debug Win32 ------
1>Linking...
1>merge sort.obj : error LNK2019: unresolved external symbol "int __cdecl mergesort(int,int)" (?mergesort@@YAHHH@Z) referenced in function _wmain
1>C:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\Debug\merge sort.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\merge sort\Debug\BuildLog.htm"
1>merge sort - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

i created this program in visual c++ 2005

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

hello guys ! i have created a program just to understand how to return a value from using a recursive program

what it does it thati have have two variable i.e first and last
the value of first is zero and last is 10

not i want the function to continue until last ==to first
if not it would simply return the value of the last and decrement here is the code and the prob listed and yes i am noob

#include<conio.h>
#include "stdafx.h"
#include <iostream>
# define size 10;
int mergesort(int,int);
using namespace std;



int _tmain(int argc, _TCHAR* argv[])
{
    int first=0,last=10;

    //cout <<" enter the vlaues";

    //for(int i=0;i<10;i++)
    //cin>>arr[i];
    cout<<mergesort(first,last);
    system("pause");
    system("pause");
    return 0;
}

int mergesort(int first,int last,int mid)
{ int a=34343434;
   cout<<"mergesort called";
    if(first==last)
    {
                cout<<"its the end of the world";

                return a;
    }

if(first=!last)

{last--;
 cout<<"\n"<<last;
 mergesort(first,last,mid);
 return last;
}
return first;
}

here is the prob and plz tell me how to over come it

1>------ Build started: Project: merge sort, Configuration: Debug Win32 ------
1>Linking...
1>merge sort.obj : error LNK2019: unresolved external symbol "int __cdecl mergesort(int,int)" (?mergesort@@YAHHH@Z) referenced in function _wmain
1>C:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\Debug\merge sort.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\muqeet\My Documents\Visual Studio 2005\Projects\merge sort\merge sort\Debug\BuildLog.htm"
1>merge sort - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

i created this program in visual c++ 2005

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

guys i was working on the link list program and its is encountring a problem its says some thing like

un handled exaption handling acess writing location error

i have no idea howto over come it so i thought may be u guys might help me with it
here is the code

// abdul muqeet khan.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include <cstdlib>
using namespace std;

struct node
{
int data;
node* next ;
node* previous;
};
node* head=NULL;
node*
previous=NULL;
char ch;
/////////////////////////////////////////////////////////////////////////////////////////
 // functio declarations 
 node* getnode();
 void addstart(int);
 void display();
 int  dataentry();
 ////////////////////////////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])

{  while(ch!='y'||'Y')
{int c;
   c=dataentry();
   
   addstart(c);
   display();}   
   cout<<"do u wanna an other go ";
   cin>>ch;
   system("pause");	
   return 0;


}


int dataentry(void)
{ int c;
  cout<<"enter the num";
  cin>>c;
  return c;
}
 //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
void addstart(int c)
{
 struct node*p;
 struct node*q;
  p=getnode();
  q=getnode();
  q=NULL;
  
  if(head==NULL)
  {p=head;
  p->next=q;
  q->next=NULL;
  }
  if(head!=NULL)
  
  {   p=head;
	  while(p->next!=NULL)
	  {
	  p=p->next;}
  } 
  p->next=q;
  q->data=c;
  q->next=NULL;
  system("pause");
  system("cls");
  
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
node* getnode()
{
 node*p;
 p=(node*)malloc(sizeof(node));
 return p;
}


void display()
{
 node*p;
 p=getnode();
 p=head;
 while(p->next!=NULL)
	 cout<<p->data;
 p=p->next;
}
a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

but i want to perform the operations on all of the text document not the end part but i wont be able to do that if only the lower part is stored on the string so i wanna know how to over come that problem thanks

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

guys i have a little problem in my file handling program that is i cant get the whole file to be saved just the end portion i want to know why this happens and how to counter it

// file handling flag testing and practise.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include<cstdlib>
#include<fstream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])


{
 fstream infile("D:\\muqeet.txt");
char name [10000];
int experience;
char city [10000];

/*infile>>"Enter Your Name(Without Space):";
cin>>name;
cout<<"Enter Your City(Without Space):";
cin>>city;
cout<<"Enter Your Experience(Without Space):";
cin>>experience;*/
while(!infile.eof())
{infile.getline(city,10000);
;}
cout<<city;
system("pause");
return 0;
}

one more thing that is if i place the cout with in the while loop it shows every word this is curious can any one explain how this happens

Attachments muqeet.txt (1.94KB)
a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

thanks it was a silly silly mistake i should have used out instead of cout i am sorry a silly mistake none the less

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

why dont u buy nook or even kindle and get it rooted
its simple as that

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

guys i have a prob i wrote the code for file handling the prob is that the code is working perfectly it also creates the file yet it doesnt store any thing in it and after the del the files it created in my hard disk he wont create any more either here is the code

// file handling flag testing and practise.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include<cstdlib>
#include<fstream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])


{
 fstream out("D:myfoldertest.txt");
char name [10];
int experience;
char city [10];
cout<<"Enter Your Name(Without Space):";
cin>>name;
cout<<"Enter Your City(Without Space):";
cin>>city;
cout<<"Enter Your Experience(Without Space):";
cin>>experience;
cout<<name<<"\t"<<city<<"\t"<<experience<<endl;

system("pause");
return 0;
}

i also used the ofstream but the diff was nil

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

the main reason why i wrote it like this was simple the most no of room repeatedly placed in booking table (where roomno is not a primary key )be an easy winner but i dont know if its possible

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

Solved: hey help me out in MS SQL

guy i was given a qeustion for my exam that
What is the most commonly booked room type for each hotel in London?

to this i replied

SELECT MAX(R.roomno)AS most room selected
      FROM ROOM.R,HOTEL.H,BOOKING.B
      GROUP BY roomtype
      WHERE H.hotelno=B.hotelno AND city='london'

my problem is that i dont know if the logic is correct or not and mysql server is not working i would be obliged if some one can tell me that my logic is true thank you all

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

thanks guy i have done it thank you so very much

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

well i self studying programming no one is teaching me

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

i dont know all i am doing is that i am sorting it out that all with my own failed logic

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0
// algo assignment.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
 using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	int DATA[5];
	DATA[0]=0;
	DATA[1]=10;
	DATA[2]=80;
	DATA[3]=1;
	DATA[4]=5;
	int a;int temp; int i,j; 

	
	for (i=0;i<5;i++)
	{     
	 temp=DATA[i];  // at starting it means that it has value zero
		for (j=i+1;j<5;j++)
		{
			
		  if(temp>DATA[j] )
		   
		  { temp=DATA[j];
		  
		  a=DATA[j-1];
		  
		  DATA[j-1]=DATA[j];

		  a=DATA[j];}
		}
		  
		  
		cout <<DATA[i]<<endl;
	
	
	}
	
			
			
			
			
			
			
			system("PAUSE");

the main purpose of this program is that i just want to sort the array in an order and it is not going like that

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

Solved: a simple question in C++

guys i just wanted to know that can we study algorithms with out studying discrete maths first?

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

thanks sir for ur help

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0

guys here is the question
elow is the main function that creates the object of Mile and Kilometer classes. Write the definition of
Mile and Kilometer classes such that each statement in the main function is executed without any error.
Both classes must have default constructor that initialize the private data member of both classes with
zero.

B
main() {
float k = 10, k1, k2 = 30 ;
Kilometer km = k;
km.display(); //display the value of data member of km and also how many objects of
// Kilometer class has been created
k1 = km;
cout<<”k1 = ”<<km<<endl;
km = k2;
km.display();
float m = 13.5, m1;
Mile mile = 25;
Km = mile;
Km.display();
Kilometer km1;
km1 = 15;
mile = km1;
mile.display(); //display the value of data member of mile and also how many objects of
// Miles class has been created
m1 = mile;
cout<<”m1 = ”<<m1<<endl;

my question is very simple i know how to convert a usertype to float type etc but how do u covert a user defined type to basic type with out the use of a constructor il be glad if u ppl can help me

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0
a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.1442 seconds using 2.62MB