473,763 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert items in different functino ?

Kay
I have a problem in inserting items in linked list. Hence, there are
different way to insert the items to the list. The first one is loading
data form a txt file(1). And the second one is input from keyboard. I
have done the first part. I have got a question in second part. Do I
need to continue the insertion by using the (1) linked list and its
position ? If yes, how to return the ptr and list position ?

Can I do sth like this ? If yes, how can I call back the same list and
oposition in other methods. If no, how can I insert other new items in
the same list by using keyboard ?

List * ReturnPtr( List * l){
return l;
}

Positino ReturnPositino( Position p){
return p;
}

Jul 22 '05 #1
1 1376

"Kay" <er*********@ya hoo.com.hk> wrote in message
news:41******** ****@yahoo.com. hk...
I have a problem in inserting items in linked list. Hence, there are
different way to insert the items to the list. The first one is loading
data form a txt file(1). And the second one is input from keyboard. I
have done the first part. I have got a question in second part. Do I
need to continue the insertion by using the (1) linked list and its
position ? If yes, how to return the ptr and list position ?

Can I do sth like this ? If yes, how can I call back the same list and
oposition in other methods. If no, how can I insert other new items in
the same list by using keyboard ?

List * ReturnPtr( List * l){
return l;
}

Positino ReturnPositino( Position p){
return p;
}


Both your functions do nothing at all, they just return the same argument
that is passed in. They are legal but they aren't going to help solve
whatever problem it is that you are facing.

It's hard to understand but you seem to have some sort of design problem. It
should not matter when inserting some data into a linked list whether that
data comes from a file or from a keyboard, the same method should work for
both cases. But maybe you have designed your classes wrongly so that it
doesn't. In fact maybe that is the point of the exercise, to show how badly
designed classes are awkward to work with.

I think to get some help you are going to have to show some of the code you
have written and explain why things aren't working as they are. I think you
are asking the wrong questions at the moment.

John
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2326
by: jean | last post by:
i'm trying to insert values into my database that contain a variable that gets incremented by one for each item in a shopping cart. item_name becomes item_name1, item_name2, item_name3, and so on for the total number of items in the cart. this code works great when i only have one shopping cart item to deal with. $sql = mysql_query("INSERT into PPorder_details (txn_id, productID)
6
2237
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a product in the database with that ID (primary key), just UPDATE the price, and if there is no product with that ID it should do an INSERT for that item. Now I've tried it in several ways and I can't seem to get it to execute
3
13224
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax: Hunter_69. Here is what the form looks like. I have the difficulty of inserting the multiple items selected by the user the first time he visits and uses the screen and then using an UPDATE when he visits later. Model | Original Price | Reduced Price...
0
1773
by: lea | last post by:
I have two combobox, I let the user to select report criteria FROM xx TO xx. i have a button call btnPrint to select report criteria and print according to the criteria. I able to SELECT the record based on the report criteria but i dunno how to print it out with the use of crystal report,because for my knowledge, Crystal report is only can retrieve all Records in the Table with generated dataset.
2
52104
by: maltchev | last post by:
i need to insert data from an xml file into sql server table. the xml file contains only one record. how to insert the data? how to map the names of the fields in the xml file and the table? thank you in advance.
2
2066
by: Ruchika Chadha via .NET 247 | last post by:
(Type your message here) Hi guys, I am new to ASP .NET. I have used the following code to add values from a database to a combobox:- Dim index As Integer = 0 For Each dRows In dSet.Tables(tableName).Rows comboBoxName.Items.Insert(index, dRows.Item(columnName)) index += 1 Next
1
1970
by: Sockpuppet | last post by:
After having googles I've knocked together ther following code. What I am trying to do is select all items in one table and move through them adding them into other tables (splitting them and putting different parts in different table linked together with relationships). THe bits that I can't figure out are: 1) how to get info from the recordset (i.e. select info from that to put into the other tables using insertSQL) 2) how to solve...
9
3219
by: David Eades | last post by:
Hi all Complete newbie here, so apologies if this is the wrong forum. I've been asked to use mysql and asp to make a simple bidding system (rather like a simple ebay), whereby users can use a web browser to view a highest bid and can make a bid. My question is; how can I be sure that when a user submits a bid, that another user isn't also currently submittimg a bid, i.e i can tell user A
5
5480
by: Me LK | last post by:
I need to add a line to choose a size into a dropdown . Since I have the dropdown nested inside a datagrid this is not working.When a page displays there are several rows of dropdowns but only the top dropdown has the option added. The others do not. I am using the following code Dim ddlPsize As DropDownList ddlPsize = (itemInfo.Items(0).FindControl("ddlsizes")) ddlPsize.Items.Insert(0, "Choose a Size")
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.