473,385 Members | 1,492 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,385 software developers and data experts.

C Term Project( structures, read files) Please Help

6
I am working on my term project and I need help. there are some parts of it I couldnt do. the question is:
---------------
1. Write a program to create a stock for the products of a company. The following details should be stored in the system
a. Name of the product
b. Number of items available
c. Unit price
The program should let the user to look for a product using its name. Also it should be possible to update the number of items available. The program should store the data in a file for later use. On running the program the data from the file will be loaded into the memory
-------------

And I tried to solve it with examples in my course book . this is what I did so far. I am having difficulties about case 2.I messed up at case 2.If you see something wrong about my solution plaese help me.my english is not good. I hope you understand me.My solution so far:
----------------------------
Removed code per Posting Guidelines
May 28 '07 #1
8 1436
gpraghuram
1,275 Expert 1GB
HI,
You have mised a break statement in case 2:
Modify it like this
Expand|Select|Wrap|Line Numbers
  1.  case '2':
  2.                                   printf(" enter product name:");
  3.                                   scanf("%s", searchname);
  4.  
  5.                                   break;
  6.  
  7.  
I pesume that this isthe only problem you are facing.
Raghuram
May 28 '07 #2
bttf
6
HI,
You have mised a break statement in case 2:
Modify it like this
Expand|Select|Wrap|Line Numbers
  1.  case '2':
  2.                                   printf(" enter product name:");
  3.                                   scanf("%s", searchname);
  4.  
  5.                                   break;
  6.  
  7.  
I pesume that this isthe only problem you are facing.
Raghuram
thnk you very much.I fixed that part. but there are lots of problems in my solution. :( anyone can help me?
May 28 '07 #3
nemisis
64
thnk you very much.I fixed that part. but there are lots of problems in my solution. :( anyone can help me?

If u can post the errors here, it would be lot faster
May 28 '07 #4
AdrianH
1,251 Expert 1GB
Hi bttf,

There are so many things wrong with this. It is just syntacticly wrong. That you say it should work leads me to believe that you didn't write it.

Also please see our Posting Guidelines located at the top of the C/C++ Forum. You are not to post your entire code for assignments.

We at TSDN are happy to help, but you must also do your part. If you are having trouble with the syntax, say so. If you are having trouble with a section of code, show that section.

Good luck. Hope that we can help you in your programme.


Adrian
May 28 '07 #5
bttf
6
If u can post the errors here, it would be lot faster
Is there any major problems with my unfinished solution.?
I am beginner at C and I have to say I am not good at it. I use DEVC++ some of errrors are :
--line 10.. two or more data types in declaration of `menuStock'
--line 32 conflicting types for 'printf'
--line 42 [Warning] data definition has no type or storage class
--line 32 a parameter list with an ellipsis can't match an empty parameter name list declaration
and there are some syntax errors :( am I solving this question in a wrong way?
May 28 '07 #6
AdrianH
1,251 Expert 1GB
Is there any major problems with my unfinished solution.?
I am beginner at C and I have to say I am not good at it. I use DEVC++ some of errrors are :
--line 10.. two or more data types in declaration of `menuStock'
--line 32 conflicting types for 'printf'
--line 42 [Warning] data definition has no type or storage class
--line 32 a parameter list with an ellipsis can't match an empty parameter name list declaration
and there are some syntax errors :( am I solving this question in a wrong way?
Do you understand the syntax of C?


Adrian
May 28 '07 #7
bttf
6
Do you understand the syntax of C?


Adrian
I dont know that much about C :( I am having difficulties in Structures subject
May 28 '07 #8
AdrianH
1,251 Expert 1GB
I dont know that much about C :( I am having difficulties in Structures subject
Oh boy. Not that I don't want to help you but it is a course in itself to teach C (or any language). Do you have any programming experence? Without some, I will have to point you at searching for a C tutorial online (go to your favorite search engine and search for "C Tutorial") so that we have a comon ground to talk on.

Let me know.


Adrian
May 28 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Aaron Toponce | last post by:
My goal is to share my VS.NET 2003 ASP.NET web application project files to my FTP server, so that my parter may copy the files and also work on the project, then repost them to my FTP site. That...
0
by: FGMer | last post by:
I am in a desparate situation and I need help. I have two servers one for the SQL DB and another for the ASP.Net code. I currently use my desktop to connect to the Application code and then edit...
1
by: Vyacheslav Lanovets | last post by:
Hello, All! Installed VS 2005... What is annoying is that project files are not backward compatible. For instance, EVC4 vcp files are backward compatible with EVC3 and can be used...
7
by: Dave | last post by:
Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an...
2
by: KevinGPO | last post by:
Just wondering if anyone knows if there are converters to convert from: MS Visual C++ 6.0 or MS Visual Studio 2003 project files into UNIX autogen/configure/make files?
2
by: Raterus | last post by:
Hi, I'm after this setup, and I'm just wondering if this is even feasible. I'd like to store my asp.net project remotely, on a network drive (all the project files, everything), But I want to be...
2
by: msnews.microsoft.com | last post by:
Why are there multiple project files for one project? There's one that seems to be stored in documents and settings (windows xp) and like 2 in the project itself. It doesn't seem to affect...
5
by: Emmanuel | last post by:
Hi, I am using VS 2003 to build my (csharp) solution. 1. Is there a way to reveal the command line options that VS is using during compilation of a project file, in order to build a batch...
5
by: Chris Peeters | last post by:
Hi, When creating an ASP.NET project in VS2005 : where are the project files (.csproj, .sln, ...) ? The only files I can find are the aspx and .code behind-files. thanks Chris *** Sent...
7
by: kelceycoe | last post by:
I know how to play a single sound, but I need code that will play any unset number of sounds at random intervals, and at random times. Also, I need to know how to embed these sounds and other project...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.