473,890 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

online C programming test

Does anyone know where I can find a good online C programming test?
I used Google to search for

"C programming test"

and found lots of stuff but the first several pages were disappointing.

Nov 14 '05
51 20155
Richard Heathfield wrote:
MSG wrote:
Yes, but others failed it many times as well, sometimes thanks to him,
e.g. when many C people stated that you could not return structs from
functions.


Er, that's bizarre. Of course you can. The Standard even gives an example of
(a pointer to) a function that returns a struct.


Further, a number of standard functions return structs (e.g. div()).

Jeremy.
Nov 14 '05 #31
Richard Heathfield wrote:
MSG wrote:
I don't want to google, but it went something like this

struct foo f() {
struct foo s;
s.x = x;
s.y = y;
s.z = z;

return s;
}

*Many* (but not ERT) said you could not do this in C.


Do you have a thread reference for that? A message ID or something?


I think MSG had this post in mind:

http://groups.google.com/gr*********...*@jpl.nasa.gov

Nov 14 '05 #32
Grumble <in*****@kma.eu .org> writes:
Richard Heathfield wrote:
MSG wrote:
I don't want to google, but it went something like this

struct foo f() {
struct foo s;
s.x = x;
s.y = y;
s.z = z;
return s;
}

*Many* (but not ERT) said you could not do this in C.

Do you have a thread reference for that? A message ID or something?


I think MSG had this post in mind:

http://groups.google.com/gr*********...*@jpl.nasa.gov


If he had that thread in mind, his and my definition of the word "many"
are completely incompatible.

Martin
Nov 14 '05 #33
Richard Heathfield wrote:

Peter Pichler wrote:

<snip>
I must regretfully say that most GPL code I
have seen looks worse. Moreover it is usually highly non-portable.
Is there a clause in GPL that I missed that says that the source
must be unreadable?


No, but there does seem to be some kind of underlying ethos of "I'm
doing this for free, so I don't have to be legible", which I find
appalling. I go to a lot of trouble to make my own code readable.
Whether I succeed is for others to judge for themselves, but at
least I try. I wish this were more common.


For the benefit of the general public, many of us have found that
writing for clarity makes things easier for the reader down the
line, and further examination of that theme reveals that that
reader is us. Even so, later re-reading often produces much
scratching of various body parts.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #34
Default User wrote:
.... snip ...
Yes, it is true that Trollsdale is not a complete idiot, which
makes him dangerous. He can talk a good game, enough to suck
the newbies in.


This is no more dangerous than any other consumate idiot posting
here. However ERTs forte is revisionism, whereby he quotes
someone and edits that quote into meaninglessness or falsity.
This forces people to watch him closely, and deny those alleged
quotes. Idiocy is forgivable, the revisionism is not.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #35
In <Pi************ *************** ********@unix47 .andrew.cmu.edu > "Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> writes:

On Wed, 4 Feb 2004, Richard Heathfield wrote:

Peter Pichler wrote:
> "MSG" <ms*****@yahoo. com> wrote:
>>
>> Yes, but others failed it many times as well, sometimes thanks to him
>> [ERT], e.g. when many C people stated that you could not return
>> structs from functions. I don't want to google, but it went something
>> like this
>>
>> struct foo f() {
>> struct foo s;
>> s.x = x;
>> s.y = y;
>> s.z = z;
>> return s;
>> }
>>
>> *Many* (but not ERT) said you could not do this in C. So let's be fair
>> here.
>
> OK, let's be fair. The code above *is* in fact illegal ;-)


Why?

<snip>
/* Here's that code again, this time in some context. */


Okay, *now* it's legal. ;-) [I can only assume that Peter was
referring to the fact that the OP had not defined 'struct foo'
anywhere in the translation unit under discussion.]


There was NO translation unit under discussion, merely a code snippet
that was NOT supposed to be a complete translation unit. People seldom
post complete translation units.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #36
Grumble wrote:
Richard Heathfield wrote:
MSG wrote:
I don't want to google, but it went something like this

struct foo f() {
struct foo s;
s.x = x;
s.y = y;
s.z = z;

return s;
}

*Many* (but not ERT) said you could not do this in C.


Do you have a thread reference for that? A message ID or something?


I think MSG had this post in mind:

http://groups.google.com/gr*********...*@jpl.nasa.gov


If that's the thread he had in mind, then "Many" appears to translate as
"Tom St Denis". Everyone else in the thread AFAICT gave appropriate and
correct answers (modulo Tisdale, on whose reply I make no comment either
way, since I didn't bother re-reading it).
--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #37
"Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote:
On Wed, 4 Feb 2004, Richard Heathfield wrote:
Peter Pichler wrote:
"MSG" <ms*****@yahoo. com> wrote:
>
> struct foo f() {
> struct foo s;
> s.x = x;
> s.y = y;
> s.z = z;
> return s;
> }
>
> *Many* (but not ERT) said you could not do this in C. So let's be fair> here.

OK, let's be fair. The code above *is* in fact illegal ;-)
Why?

<snip>
/* Here's that code again, this time in some context. */


Okay, *now* it's legal. ;-) [I can only assume that Peter was
referring to the fact that the OP had not defined 'struct foo'
anywhere in the translation unit under discussion.]


Bingo! Plus missing declarations for x, y and z. And yes, I knew it was a
code fragment that would make sense in context, hence my smiley.
For reasons explained elsethread, I am firmly *against* returning
structs from functions, [...]


I am not strictly against, but I don't do it myself.

Peter
Nov 14 '05 #38
In article <news:Pi******* *************** *************@u nix47.andrew.cm u.edu>
Arthur J. O'Dwyer <aj*@nospam.and rew.cmu.edu> writes:
Mostly, it's that returning structs is
- not transparent enough for my taste
- almost always easy to do another way, at least in my code
- not the way I first saw it done (K&R1 explicitly mentions that
you couldn't pass structs *to* functions in Ye Olde C, but I didn't
find any mention of *returning* structs, not that I looked very hard).
This is the real meat of my argument; I *said* it was religious! :)


It might be worth noting that the Portable C Compiler (one of
several common compilers, and perhaps even the most common,
implementing C at the time the K&R "white book" came out)
handled struct-value returns with non-reentrant code.

Specifically, it rewrote:

struct S f(...) { ... return val; }
...
result = f(...);

as:

struct S *f(...) {
static struct S retval;
...
retval = val;
return &retval;
}

result = *f(...);

(the ellipses here are neither K&R-1 C nor ANSI C, but rather
meant to imply "actual arguments do not matter").

The hidden-pointer-parameter method that gcc uses on the i386 is
"better", in my opinion, in that it is reentrant and can often
avoid some copying. It does, however, require that a declaration
of f() be in scope even if the caller intends to ignore the return
value. (Returning small structures in registers is even better
yet, of course, but often incompatible with vendor ABIs.)
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #39
MSG
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote in message news:<bv******* ***@hercules.bt internet.com>.. .

Do you have a thread reference for that? A message ID or something?
I can't find it,


Neither can anyone else, it seems.


Calling me a liar, heh? Very smooth.

BTW, many == 3 in this case:
Tom wrote "not valid"
Jarno (agreed?)
Nick implied that returning automatically allocated structs was
undefined

Not bad for an "idiot troll"
given the limited time I have and the fact that I do
not recall any rare "keywords" from that thread. However, take a look
at this bit of ERT wisdom (pay attention to comments in asm code)

http://groups.google.com/groups?selm...40jpl.nasa.gov

which is not as good as what I wanted to find, but nevertheless.


Nevertheless, it is an article in which Mr Tisdale demonstrates how one may
post off-topic articles on assembly language instead of giving an
appropriate answer based on the semantics of the C language.
I think ERT lacks some social skills, granted, who doesn't? But
branding him a troll is probably a fruit of groupthink.


Do you? I think you just don't know him well enough.


Even better! Think of me as a juror, not his defense attourney - I
think he's fit to represent himself. So far, I haven't seen the
"prosecutio n" try to make a case - all I saw was a bunch of emotional
people with old grudges. If you think *you* have a case, make it once,
say, post 3 links/msg-id's that conclusively show him to be a troll.
Of course, we must each
make up our own minds on these matters; but I think you're wasting your
time if you seek to persuade anyone who knows C that Mr Tisdale is worth ^^^^^^^^^^^^^^^ ^^^ reading.


It must be one of those "true Irishman" arguments.

BTW, anyone who "knows C" would only find "off-topic" messages
interesting here.
Nov 14 '05 #40

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

Similar topics

1
2173
by: vpd | last post by:
hi, I want some help in organising an online programming contest. Is there a ready made solution available in PHP or even Perl which I could use? The contest is supposed to be based on C programming and the solutions submitted by the participants must be compiled, executed and the marks shall be allocated automatically. I want some urgent help as the contest is supposed to be organised in just a couple of days. Any suggestions and...
13
2733
by: Varun | last post by:
Hi Friends, Department of Information Technology, Madras Institute of Technology, Anna University, India is conducting a technical symposium, Samhita. As a part of samhita, an Online Programming Contest is scheduled on Sunday, 27 Feb 2005. This is the first Online Programming Contest in India to support Python !!!!. Other languages supported are C and C++.
0
1341
by: Sridhar | last post by:
Hi, We, the students of CEG, Anna University are organizing an online programming contest as part of aBaCus 2005. The contest itself will start on 6th March 2005 at 1:00 pm IST and will end after 5 hours. You have to solve the problems posted at the start of the contest. Teams ranking high will be awarded the prizes. As a special note, inspite of C,C++ and Java we also allow Python this time. So we hope a lot of Pythonistas...
0
1625
by: Sridhar | last post by:
Hi, We, the students of CEG, Anna University are organizing an online programming contest as part of aBaCus 2005. The contest itself will start on 6th March 2005 at 1:00 pm IST and will end after 5 hours. You have to solve the problems posted at the start of the contest. Teams ranking high will be awared the prizes. As a special note, inspite of C,C++ and Java we also allow Python this time. So we hope a lot of Pythonistas...
14
1676
by: pravink | last post by:
Hi all, I am interested in knowing any periodic (montly/weekly) programming challeages held on internet...Does anybody know about such sites? Focus should be on algorithm development and programming skills. For example, I found this (http://www.mactech.com/progchallenge/)...but seems they have stopped it now... thanks in advance, pravink
2
5867
by: aarklon | last post by:
Hi folks , Online C test at: http://www.testyourabilities.com/webui/TestDesktop/Screens/Test.aspx
0
1367
by: Romram | last post by:
BITWISE is an annual online programming contest. The contest is organized by the Computer Science and Engineering Department Society of IIT Kharagpur, on the second Sunday of February every year. The contest is time constrained and you would be expected to submit solutions to some of the toughest programming and algorithms challenges in a short span of 12 hours. Prizes worth 120,000 Rs or $2600 at stake. Visit...
0
1335
by: Turbo | last post by:
Please ignore if you are not interested in programming contests. IIIT Hyderabad invites you to our annual Online Programming Contest CodeCraft 2007. This is the 5th year of Codecraft. It has grown over the years and has witnessed huge participation on a global scale. The contest is known for having a high quality problemset. It will be held on February 21st, 2007, 6 PM - 12 AM IST. ( GMT 1230 hrs - 1830 hrs).
0
9826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10829
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10925
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5854
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.