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

c++ help (new to programming)

what the values of the following expressions: if illegal or unpredictable
please state so.

stat char *arrax ="C is my favourite";
stat char *lp=arrax;
static int five=5;

a)*(arrax + 8)
b)*arrax+2
c)lp[10]
d)12[arrax\

Jul 23 '05 #1
8 1159

"t3hseen" <t3*****@yahoo.com> wrote in message
news:3e******************************@localhost.ta lkaboutprogramming.com...
what the values of the following expressions: if illegal or unpredictable
please state so.

stat char *arrax ="C is my favourite";
stat char *lp=arrax;
static int five=5;

a)*(arrax + 8)
b)*arrax+2
c)lp[10]
d)12[arrax\


Homework?

Jul 23 '05 #2
yes

Jul 23 '05 #3
t3hseen wrote:
what the values of the following expressions: if illegal or unpredictable
please state so.

stat char *arrax ="C is my favourite"; Undefined symbol "stat". Thus illegal.
stat char *lp=arrax; Undefined symbol, "stat". Thus illegal.
Symbol "arrax" is undefined.
static int five=5; Valid.
But why is everything static? Hmmmm.
Actually, the "static" has nothing to
do with legality or predictability of
the next expressions.

a)*(arrax + 8) Undefined symbol "arrax", due to syntax
error.
See also arrax[8].
b)*arrax+2 Undefined symbol "arrax", due to syntax
error.
See also arrax[0] + 2.
c)lp[10] Undefined symbol "lp", due to syntax
error.
Since lp == arrax, expression is the
same as arrax[10].
d)12[arrax\

"Unexpected end of file encountered",
due to '\' at end of line.

This one, and the others, are in a C
and C++ textbook as well as the FAQ.
See below.
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
Jul 23 '05 #4

"t3hseen" <t3*****@yahoo.com> wrote in message
news:eb******************************@localhost.ta lkaboutprogramming.com...
yes


http://www.parashift.com/c++-faq-lite

(see esp. section 5.2)
Jul 23 '05 #6
t3hseen wrote:
yes


Give me your instructor's email, so I can save you the trouble of
submitting it yourself, since you don't want to do the work.
Jul 23 '05 #7
"t3hseen" <t3*****@yahoo.com> wrote in message
news:eb******************************@localhost.ta lkaboutprogramming.com...
yes


As you can see from the responses, you were doomed once you decided to be
honest.

BTW, people are far more inclined to help if you try to answer the questions
yourself and post the work you've done.

DW
Jul 23 '05 #8
guys, thanks for the help you have provided, i apologize if you thought i
was trying to GET you to do my hw, for i did not know to post what i
thought it was as well,

more importantly i appreciate the links to the tutorials, faq sections

Jul 23 '05 #9

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

Similar topics

4
by: Mark | last post by:
Hello. I am new to programming and Python and was wondering if someone could help get me started. I picked Python to start learning to prgram because of some things I have read about it (easy to...
2
by: noone | last post by:
Hello all, I am absolutely brand new to perl, but I understand that it is a very important aspect of web development to create dynamic web pages. I am kind of short on money, being a college...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
9
by: tjones | last post by:
Hi, I am guessing this is *THE* nntp newsgroup for C#? I was hoping someone could point me in the right direction. Id like to find employment in the IT industry as a programmer again. My...
4
by: Mike | last post by:
Hi, I am planning on purchasing VS2005 to learn C# very soon, and I need good book recommendations. I realize this is a question that may be asked a lot, but please consider my background: I...
0
by: Samineni | last post by:
Welcome to comp.lang.c++! Read this first. This post is intended to give the new reader an introduction to reading and posting in this newsgroup. We respectfully request that you read all the...
13
by: 1jasong | last post by:
Hello I am new to programming and want to know what is a good free compiler is. I am asking this because there are so many of them and I just want to start programming also a good website for...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
1
by: blangela | last post by:
Bjarne Stroustrup has a new text coming out called "Programming: Principles and Practice Using C++" (ISBN: 0321543726), due to be published in December of this year. Some of the features of this...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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.