473,385 Members | 1,772 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.

i want help in visual c++ code

Consider the following code:
struct MyStructure
{
char MyString[40];
int MyInteger;
};

MyStructure StructVariable[20];
MyStructure *StructPointer;

StructPointer = StructVariable;

i. Does this code have any error(s)? If there correct it.
ii. Store some values (in member variables MyString and MyInteger) in 15th element of the array StructVariable using StructPointer.
Nov 8 '08 #1
4 1276
Banfa
9,065 Expert Mod 8TB
i. What apart from the obvious that you have not put in a main function? The answer rather depends on whether you think you are writing C or C++ code. Have you tried to compile it? What did the compiler say?

ii. Thank you but with 20 years of programming experience I have no need to attempt such a simple exercise! I suggest you attempt the problem that way you may learn something, there is a fine article on arrays here.
Nov 8 '08 #2
JosAH
11,448 Expert 8TB
If there correct it.
You forgot to say the magic word; do it yourself it is your homework exercise
after all.

kind regards,

Jos
Nov 8 '08 #3
i. What apart from the obvious that you have not put in a main function? The answer rather depends on whether you think you are writing C or C++ code. Have you tried to compile it? What did the compiler say?

ii. Thank you but with 20 years of programming experience I have no need to attempt such a simple exercise! I suggest you attempt the problem that way you may learn something, there is a fine article on arrays here.
thanks but i am not going to compile it i tried and get this solution please tel me is it correct or not
struct MyStructure
{
char MyString[40];
int MyInteger;
};

MyStructure Variable[14];
MyStructure * Variable Ptr;
MyStructure Variable = {"hello sir",50};
Nov 8 '08 #4
JosAH
11,448 Expert 8TB
We are not going to compile it for you either; did you try to compile it? What did
your compiler say about it? We are not a free compiling service nor are we a free
do-your-homework service.

kind regards,

Jos (moderator)
Nov 8 '08 #5

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

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
6
by: Peter Row | last post by:
Hi, Can someone give me a set of steps for an ASP.NET project (well actually its just a VB.NET class DLL that implements HttpHandler) that will work when moved to another developers machine? ...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
8
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
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: 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
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: 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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.