473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Help on (*Ptr)

Hi Everyone,

I want to make a system that simulates the movements of a debit card.
This system must keep the numbers of card, name of added users, as well
as the date of the emission of each card and the dates and type of the
ten last movements. The system must allow to create, to erase, to
change and to list the cards. I have Already developed some code, but
now I´ve a problem in this situation...

void Insert_card (PtrCl *lista)
{
work´s well
}
void Change_card (PtrCl *lista)
{
work´s well
}
void Remove_card (PtrCl *lista)
{
work´s well
}
void Ver_cards(PtrCl *lista)
{
I cant associate more than one record data of "void trans_cards(PtrCl
*lista)" per card
}
void trans_cards(PtrCl *lista)
{
}
Can anyone help in this regard.

Thanks in advance!!!

Jan 15 '07 #1
12 1376
Dear customer

We are ready to fulfill your request, and we thank you for the
confidence you give us by placing your order.

Please buy products for US$ 200 at our website. When your VISA
card payments are accepted we will gladly send you the requested
program.

Yours sincerely

J.K. OB

Customer support.

P.S.
Our website address:
www.DoMyHomework.com
Jan 15 '07 #2
Ico
Progressus <pr********@gmail.comwrote:
Hi Everyone,

I want to make a system that simulates the movements of a debit card.
This system must keep the numbers of card, name of added users, as well
as the date of the emission of each card and the dates and type of the
ten last movements. The system must allow to create, to erase, to
change and to list the cards. I have Already developed some code, but
now I?ve a problem in this situation...

void Insert_card (PtrCl *lista)
{
work?s well
}
void Change_card (PtrCl *lista)
{
work?s well
}
void Remove_card (PtrCl *lista)
{
work?s well
}
void Ver_cards(PtrCl *lista)
{
I cant associate more than one record data of "void trans_cards(PtrCl
*lista)" per card
Ah, I see. The error is at line 42, check your code.
--
:wq
^X^Cy^K^X^C^C^C^C
Jan 15 '07 #3
"Progressus" <pr********@gmail.comwrote in message
news:11*********************@m58g2000cwm.googlegro ups.com...
>Hi Everyone,

void Ver_cards(PtrCl *lista)
{
I cant associate more than one record data of "void trans_cards(PtrCl
*lista)" per card
}
There isn't quite enough information in your post to understand what you
need.

If this is just a linked list one-to-many issue ...

In 'C', if you want to build a linked structure where the number of children
(or items linked to) is known in advance, you can just define the fields
statically in a structure. You might find such an arrangement in a linked
list or classic binary tree.

However, if a node has a variable number of children, then you typically
use:

a)A dynamically-allocated node, containing the node data, and containing a
pointer to ...

b)A dynamically-allocated array of pointers, each of which points to a child
in the form of (a).

(b) gets a bit complex because you need to keep track of how many pointers
are there and realloc() as needed to grow the list.

If this isn't your question, you need to post more information.

--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
Jan 15 '07 #4
Here´s my code... please comment...
Thks

void list_cards (PtrCl *lista)
{
PtrCl aux=(*lista);
if (aux!=NULL)
{
while (aux!=NULL)
{
clrscr();
printf ("\nCard Movs : ");
printf ("\nType of Mov -");
switch(aux->trans_tipo)
case CRG: printf("CRG");
break;
case DBT: printf("DBT");
break;
case TRF: printf("TRF");
printf ("\nDate of Mov ->%d /%d
/%d",aux->diatrans,aux->mestrans,aux->anotrans);
getch ();
aux=aux->next;
}
}
else
Erro ("Error!");
}
void mov_card (PtrCl *lista)
{
PtrCl aux=NULL, inicio=NULL;
int cod=0,cont;
if ((*lista) != NULL)
{
printf ("\nCard Number -");
scanf ("%d", &cod);
aux=(*lista);
while (aux!=NULL && aux->num_card!=cod)
aux=aux->next;
if (aux!=NULL)
{
clrscr();
printf ("Data Mov\n\n");
printf ("\n Date of Mov (dd/mm/aa):");
printf ("\n Day");
scanf("%d",&aux->diatrans);
printf ("\n Month");
scanf("%d",&aux->mestrans);
printf ("\n Year");
scanf("%d",&aux->anotrans);
printf ("\n Type of Mov:\n 1 - CRG\n 2 - DBT\n 3 - TRF\n");
scanf("%d",&aux->trans_tipo);
printf ("Data completed.");
getch ();
}
else
Erro ("Error!!!");
}
else
Erro ("\nError !!!");
}

Jan 15 '07 #5
"Progressus" <pr********@gmail.comwrote in message
news:11**********************@38g2000cwa.googlegro ups.com...
Here´s my code... please comment...
Thks

You need to pose a specific question. What are you wanting to do that you
can't?

--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
Jan 15 '07 #6
David T. Ashley said:
"Progressus" <pr********@gmail.comwrote in message
news:11**********************@38g2000cwa.googlegro ups.com...
Here´s my code... please comment...
Thks

You need to pose a specific question.
Why? This is a discussion group, not a helpdesk.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 15 '07 #7
Progressus wrote:
>
Here´s my code... please comment...

void list_cards (PtrCl *lista)
{
PtrCl aux=(*lista);
if (aux!=NULL)
{
while (aux!=NULL)
{
clrscr();
.... snip ...

It doesn't have a chance. It lacks a main, any declarations, any
#includes, it uses non-existant routines such as clrscr(), and it
is totally illegible lacking proper indentation and formatting. It
is also totally unconnected to anything, due to the lack of
suitable quoting. Your mark is F-.

--
"The power of the Executive to cast a man into prison without
formulating any charge known to the law, and particularly to
deny him the judgement of his peers, is in the highest degree
odious and is the foundation of all totalitarian government
whether Nazi or Communist." -- W. Churchill, Nov 21, 1943
Jan 15 '07 #8
Richard Heathfield a écrit :
David T. Ashley said:

>>"Progressus" <pr********@gmail.comwrote in message
news:11**********************@38g2000cwa.googleg roups.com...
Here´s my code... please comment...
Thks

You need to pose a specific question.


Why? This is a discussion group, not a helpdesk.
I agree with mr heathfield.

enough is enough!

Why should we do the homework of all the students in the world?

I have a standard message (that I posted in this thread)
for this kind of recurring post. Please let's stop
aiding lazy students!

jacob
Jan 15 '07 #9
jacob navia wrote:
Richard Heathfield a écrit :
David T. Ashley said:
Progressus wrote:
Here´s my code... please comment...
Thks

You need to pose a specific question.
Why? This is a discussion group, not a helpdesk.
I agree with mr heathfield.

enough is enough!

Why should we do the homework of all the students in the world?
Nothing in the contents of the OP's posts to this thread indicate that
it is an homework problem. He could be someone trying to learn C
privately.

I agree though that the code posted for review is illegible enough to
deter most potential responders.
I have a standard message (that I posted in this thread)
for this kind of recurring post. Please let's stop
aiding lazy students!
Yes I've seen it. It's not nice to include a link to a non-existing
website, letting a possibly naive OP waste his time and bandwidth. A
simple line to the effect that requests for code are not encouraged or
responded to would be sufficient response.

Jan 15 '07 #10
Progressus said:
Here´s my code... please comment...
foo.c:17: warning: string constant runs past end of line
foo.c:1: parse error before `*'
foo.c:2: warning: function declaration isn't a prototype
foo.c: In function `list_cards':
foo.c:3: `PtrCl' undeclared (first use in this function)
foo.c:3: (Each undeclared identifier is reported only once
foo.c:3: for each function it appears in.)
foo.c:3: parse error before `aux'
foo.c:4: `aux' undeclared (first use in this function)
foo.c:4: `NULL' undeclared (first use in this function)
foo.c:8: warning: implicit declaration of function `clrscr'
foo.c:9: warning: implicit declaration of function `printf'
foo.c:12: `CRG' undeclared (first use in this function)
foo.c:12: warning: unreachable code at beginning of switch statement
foo.c:14: `DBT' undeclared (first use in this function)
foo.c:16: `TRF' undeclared (first use in this function)
foo.c:17: warning: ANSI C forbids newline in string constant
foo.c:19: warning: implicit declaration of function `getch'
foo.c:24: warning: implicit declaration of function `Erro'
foo.c: At top level:
foo.c:26: parse error before `*'
foo.c:27: warning: function declaration isn't a prototype
foo.c: In function `mov_card':
foo.c:28: `PtrCl' undeclared (first use in this function)
foo.c:28: parse error before `aux'
foo.c:30: `lista' undeclared (first use in this function)
foo.c:30: `NULL' undeclared (first use in this function)
foo.c:33: warning: implicit declaration of function `scanf'
foo.c:34: `aux' undeclared (first use in this function)
foo.c:29: warning: unused variable `cont'
make: *** [foo.o] Error 1
Thks
No problem.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jan 15 '07 #11
"santosh" <sa*********@gmail.comwrote in message
news:11**********************@51g2000cwl.googlegro ups.com...
>Yes I've seen it. It's not nice to include a link to a non-existing
website, letting a possibly naive OP waste his time and bandwidth. A
simple line to the effect that requests for code are not encouraged or
responded to would be sufficient response.
Believe it or not, www.domyhomework.com is a bona fide site.

--
David T. Ashley (dt*@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
Jan 15 '07 #12
On Jan 15, 4:00 pm, "santosh" <santosh....@gmail.comwrote:
jacob navia wrote:
Richard Heathfield a écrit :
David T. Ashley said:
>Progressus wrote:
>>Here´s my code... please comment...
>>Thks
>>You need to pose a specific question.
Why? This is a discussion group, not a helpdesk.
I agree with mr heathfield.
enough is enough!
Why should we do the homework of all the students in the world?
Nothing in the contents of the OP's posts to this thread indicate that
it is an homework problem. He could be someone trying to learn C
privately.
Erm... doesn't the following resemble homework instructions? =)
"This system must keep the numbers of card, name of added users, as
well
as the date of the emission of each card and the dates and type of
the
ten last movements. The system must allow to create, to erase, to
change and to list the cards."
Of course, there is a possibility that (s)he wrote the specs, it just
doesn't seem very probable.
--
WYCIWYG - what you C is what you get

Jan 15 '07 #13

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

Similar topics

5
by: Jeff Greenberg | last post by:
Not an experienced c++ programmer here and I've gotten myself a bit stuck. I'm trying to implement a class lib and I've run into a sticky problem that I can't solve. I'd appreciate any help that I...
13
by: Buck Rogers | last post by:
Hi guys! I am trying to do an excercise from my C book, which coincidently is very similar to the one in the recent "program" thread. Task: Write a program that uses redirection to accept...
2
by: ANaiveProgrammer | last post by:
Hi all I have been trying to send a struct over socket. I tried to assign the values of struct to unsigned char array. I have attached both .c files at the bottom. 'Client.c' takes a struct,...
2
by: ste | last post by:
VS2005, .NET2 I have a dll that is using TraceSources with no problems. The dll is linked to a webservice. The webservice creates its own traceSource and every thing looks fine.. however...
13
by: Protoman | last post by:
Here's a non intrusive reference counting smart pointer class I'm working on; I keep getting a "22 C:\Dev-Cpp\SmrtPtr.hpp ISO C++ forbids declaration of `SmrtPtrDB' with no type" error. Code: ...
5
gekko3558
by: gekko3558 | last post by:
I am writing a simple binary search tree (nodes are int nodes) with a BSTNode class and a BST class. I have followed the instructions from my C++ book, and now I am trying to get a remove method...
20
by: DemonFox | last post by:
i have started my midterm exersize than is on binary treescan anyone help me on the basics i have started and i have made the following on my tree.h file: struct treenode { int data;...
4
by: Willy Wijaya | last post by:
I have wrote this code.. But when i try to compile it using gcc in PCLinuxOS 2007, i got this message "Help me about segmentation fault (core dump)" when I run the client script.. //CLIENT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.