PDA

View Full Version : Anyone here who has taken up C and C++ ? I need help!!


wushoo
Oct 13, 2000, 03:27 AM
HELP!!

sabotahe
Oct 13, 2000, 06:46 AM
pare! i can relate!

moody_meeh
Oct 13, 2000, 07:25 AM
What's the question??

kirei041179
Oct 13, 2000, 08:45 AM
----
sorry wushoo... im not dat expert in C/C++ (gusto mo tanong ko na lang sa opismeyt ko) kung vb sana yan!!!

kirei <----wow feeling naman :D



----
http://smilecwm.tripod.com/net4/bl_paw.gif

yuga
Oct 13, 2000, 10:08 AM
maybe if you post this on the C&C forum, mas maraming makatulong sa yo...
:smokin:

Kaide
Oct 13, 2000, 10:27 AM
Bakit? may Machine Project ka? TUngkol where ba?---(naks naman) :lol:

MangDyak
Oct 13, 2000, 09:50 PM
wats ur problem sa c? sus c lang e, no sweat! just tell me kung ano

uptowngirl
Oct 13, 2000, 10:14 PM
Aba! Andaming helpful! :)

Wushoo...sabihin mo na problema. What's your MP?

bottie
Oct 13, 2000, 10:18 PM
hello! hmm, hinde ako expert, pero i'm willing to help.. what's it gonna be? what's yer prob about? (naks as if alam ko lahat.. ) :silly:

dre
Oct 14, 2000, 01:44 AM
ako, i had taken up c during 1st year and i took c++ last summer. pero, don't get the wrong ideas--konti lang alam ko.

if in case naman na d ko din alam, tatanungin ko na lang yung classmate ko--the best!

so what's the prob?

Blue Knight
Oct 14, 2000, 05:32 PM
what is u're problem about c++ ? let me help u kid.

fridoh
Oct 14, 2000, 10:00 PM
ang dami nang gustong tumulong sa yo (including me) Blue Knight pero hanggang ngayon di mo pa rin sinasabi problema. ano ba talaga kuya ?

Vic Sotto & the Poponuts
Oct 14, 2000, 10:04 PM
Ako rin! Ako rin! :D C, C++ or Visual C, nde jk ***, nde ako marunong ng Visual C pero machine proj. sa C++, Oks lang, kahit libre ok lanG! ;)

GirlNextDoor
Oct 15, 2000, 01:48 AM
asows! wushoo! katagal mag-post! ano ba gusto mo, private tutor?! :D

post na dali!!!

Blue Knight
Oct 15, 2000, 04:16 AM
Go ahead and don't be shy. So what's the problem about C and C++ ? Just tell us about u're problem regarding these programming languages. I'll waiti until next week coz by that time i'll be busy with Java.

wushoo
Nov 20, 2000, 10:48 PM
here's my project and ang labo! di ko alam kung pano ko ito uumpisahan:
************************************************************
For this assignment, you are going to write a program in C (no C++ specific commands allowed) to maintain a file of student records. There are three (3) required elements to this project:

File I/O - Student records must be stored in a text file. You must read and write all data from this file. The name of the file must be passed to the program as a command line aurgument.

Struct's - Each individual student record must be loaded into memory as a struct

struct student {
char firstname[10];
char lastname[10];
char classname[6];
int points;
char grade;
double gpa;
};


Dynamic Memory - The memory to hold each student record must be dynamically allocated using the malloc function. DO NOT allocate a large static array for student arrays. When the program starts, read the entire file and count the number of records, then allocate enough memory for all the records plus 20% extra for new records. Then go back and load the student records into the dynamically allocated space.
To declare a pointer to a student struct (note: C and C++ differ ): struct student * ptr;

To input fields from the file: scanf(...);

To access a field in a struct using a pointer: printf("%s",ptr->lastname);


Your program should implement the following commands:

New - Add a new student record to the file. Use the extra space allocated when the program started.
List - List all student records currently in memory, place a record number (0,1,2…) in front of each.
Edit - Allow users to change a student record, use the record number to select which student.
Save - Write the current student records from memory out to the file.
Find - Allow users to input a search string, then print all student records (with record number) that match.
Exit - Exit the program, ask the student to save/discard changes if any updates have been made.
Optional Features

Implement an Open command:

Open - Open a new student record file. The program will have to prompt the user to save/discard the current student file if it has changed. Next the program should free the memory currently used. Finally the program prompts the user to input another filename and loads that file.



Here is an example student data file:

Chris Ferguson cs235 180 A 3.2
Tom Smith cs235 120 C 3.1
Larry Jones cs235 195 A 3.30
Chuck Johnson cs235 170 B 3.400
Sally Smith cs235 165 B 2.20
Lisa Jones cs235 110 D 2.9
Fred Washing cs235 155 C 2.2
Brad Clinton cs235 170 B 2.2
Tim Smithers cs235 129 C 1.9000
John Simpson cs235 166 B 4.0

wushoo
Nov 20, 2000, 10:49 PM
thank you in advance mga chong! hehehe

Willie Tang
Nov 22, 2000, 05:25 AM
Answering dat wud take a lot of time and space para sa isang reply lang a...:)...:)

Pero here's some helps:

1.) gawin mo muna *** takbo ng program, the menu muna, i do dat 'cause mas malalaman ko kung alin ang una kong gagawin...:)

2.) since u know d structure na, madali na ang kumuha ng input, right? writing it to a text file is ALMOST the same as writing it to a screen, actually, sa pagka-alam ko...:)

3.) do d optional last, wala kwenta extra points kung babagsakin ka na, right???...:)

Well, kung meron u a more small & specific prob, post again...:).

wushoo
Nov 23, 2000, 07:41 PM
umm.. pano ulit? medyo malabo kasi tong project na to eh..

wushoo
Nov 25, 2000, 07:42 AM
mga peeps! tulong naman o.. thank you!!

zimdude
Nov 27, 2000, 07:08 AM
... if you don't know where to start, I think you didn't study C at all? this is a "textbook" project that you can solve with textbook materials.

wushoo
Nov 27, 2000, 07:17 AM
it's not that i dont know where to start. obviously, i cant do this by myself so im trying to ask help from the peeps here. thanks.

JuVeNiLe
Nov 28, 2000, 11:25 PM
wow. pano yan? sounds tough. tulungan naman natin si pareng wushoo. sorry, la akong alam sa C! hehehehehehe

Noesis
Nov 29, 2000, 10:53 AM
May problema ako medyo similar yung kay wushoo; nung sinubukan ko na i-implement yung "fopen" sa C, medyo nagrereklamo yung compiler. Eto yung sample niya:

FILE *fout;
fout = fopen("file.dat","w"); //mali daw ang pagkakasulat nitong line//

Ano yung mga posibleng mali niya at paano siya maitatama? Help!

Noesis
Dec 1, 2000, 09:53 AM
paki-ignore na lang ng post ko sa taas. TY :)

JD4
Dec 12, 2000, 09:43 AM
lagot ka wooshu..........kilala ko prof mo!!!

JD4
Dec 12, 2000, 10:58 AM
Originally posted by JD4
lagot ka wooshu..........kilala ko prof mo!!!


Hoy *** ka?!!!!....cra ka bakit mo ginagamit nick ko?!!!!!...mag register ka na lang imbes na gumamit ka ng nick ng iba!!!!!!!!!!:grrr::grrr::grrr: