2,384 Posted Topics

Member Avatar for ellisrn

The following header is deprected, instead try to use <iostream>[code]#include <iostream.h>[/code]You shouldn't have the equals sign here.[CODE]#define q = 3[/CODE]I have no idea what this is intended to do.[code]int n; if (n < 0) return 0;[/code]Again, your code it a little unclear here. It says to declare a variable [font=Courier …

Member Avatar for Fbody
0
1K
Member Avatar for ankit_the_hawk

[QUOTE=Aia;304293]What upset me sometimes is that any book or video tutorial that tries to teach you C programming, all of them teach you to use gets() and scanf() as the default to read input. I understand that is easy for learning but it should be shown what problems you get …

Member Avatar for thisun
0
13K
Member Avatar for Kadence

Extraneous: [url]http://predef.sourceforge.net/preos.html#sec24[/url] [url]http://predef.sourceforge.net/[/url]

Member Avatar for Susel1
0
3K
Member Avatar for jimFan
Member Avatar for Serunson

[QUOTE=jbennet;386060]I also like metallica Black Album (its called metallica thats kinda its unofficial name)[/QUOTE]Any of the other older stuff? Gotta have 'Puppets. Trivia: the DJ got a kick out of playing "Metallica" for the "first dance of bride and groom" at my wedding -- it happened to be from the …

Member Avatar for blackcathacker
0
1K
Member Avatar for Dani

Please stop using [url="http://www.research.att.com/%7Ebs/bs_faq2.html#void-main"]void main[/url].

Member Avatar for WaltP
0
662
Member Avatar for kedar_challa

A [url=http://groups.google.com/groups?q=prevent+inheritance+group:comp.lang.c%2B%2B]start[/url]?

Member Avatar for Karty619
0
725
Member Avatar for curly3top

Was there a question there? Isn't your compiler telling you things that are wrong?

Member Avatar for pseudorandom21
1
227
Member Avatar for DotNetUser
Member Avatar for pseudorandom21
-1
2K
Member Avatar for jasimp
Member Avatar for vmanes

Hmm... [url]http://jitcrunch.cafepress.com/jitcrunch.aspx?bG9hZD1ibGFuayxibGFuazo5MF9GLmpwZ3xsb2FkPUwwLGh0dHA6Ly9pbWFnZXMuY2FmZXByZXNzLmNvbS9pbWFnZS8xODkyNTcwN180MDB4NDAwLmpwZ3x8c2NhbGU9TDAsNDAwLDEyMCxXaGl0ZXxjb21wb3NlPWJsYW5rLEwwLEFkZCw0MCwxODB8bG9hZD1tYXNrLGJsYW5rOjkwX0ZfbWFzay5qcGd8Y29tcG9zZT1ibGFuayxtYXNrLE1hc2ssMCwwfGNwPXJlc3VsdCxibGFua3xzY2FsZT1yZXN1bHQsMCw0ODAsV2hpdGV8Y29tcHJlc3Npb249OTV8[/url] ?

Member Avatar for Lardmeister
0
600
Member Avatar for Michael_Knight

Not a favorite, but [QUOTE="Nikita Kruschev"]We cannot expect the American people to jump from Capitalism to Communism, but we can assist their elected leaders in giving them small doses of Socialism until they awaken one day to find they have Communism. [/QUOTE]

Member Avatar for happygeek
0
1K
Member Avatar for The Dude

I've done that one before. It's rather cool. [url]http://www.grand-illusions.com/images/articles/opticalillusions/three_dragons/three_dragons.wmv[/url]

Member Avatar for vegaseat
1
90
Member Avatar for chound

[QUOTE=chound]Is it possible to create programmes to run on coumputers thad do not have any operating systems? :evil: :cheesy: :sad:[/QUOTE]That's generally what I do, so yes.

Member Avatar for aer9998
2
222
Member Avatar for xshashiy
Member Avatar for slygoth
0
225
Member Avatar for Asif_NSU

>WHY am I allowed to do this??????? You are not [i]allowed[/i] to do this. Undefined behavior is, well, undefined behavior. It could behave how you think is "correct", it could crash, it could something completely different. Now I'll admit, if all undefined behavior required something hideously harsh like reformatting your …

Member Avatar for ahtaniv
0
792
Member Avatar for lara_

[QUOTE=lara_]i dunno whether this question has been ask before but i've try to search but didn't found. so i ask it here... very simple... if i declare [b]int Z; cin >> Z;[/b] if I enter integer, it works fine but i enter character it's looping. :sad:[/QUOTE] If you enter characters …

Member Avatar for Hymppis
0
347
Member Avatar for ckid
Member Avatar for kookai

A search for [I]Fibonacci[/I] here or with Google ought to give you enough to start with, if not something to finish with.

Member Avatar for Nick Evan
0
2K
Member Avatar for karen_CSE

This is assignment. (The subsequent comparison is always true.)[code]if (input = 1)[/code]This is comparison.[code]if (input =[COLOR=Blue]=[/COLOR] 1)[/code]Ever here the phrase, "What happens in Vegas stays in Vegas" (or something similar)? Well, function are like that too. Whatever happens to a local variable inside a function is lost on the outside …

Member Avatar for hammadk
-1
2K
Member Avatar for EngSara
Member Avatar for Dave Sinkula

Very early on when attempting to learn programming in C, you often do exercises that read in and print out strings and numbers. Now you might assume that C has a simple function that will get user input, and indeed it does, but there are a couple of gotchas that …

Member Avatar for WaltP
10
8K
Member Avatar for bill13

[CODE]void foo(int a[6][6]) { int i, swap[6]; for (i = 0; i < 3; ++i) { memcpy(swap, a[i], sizeof swap); memcpy(a[i], a[5 - i], sizeof swap); memcpy(a[5 - i], swap, sizeof swap); } }[/CODE]

Member Avatar for Mohtadeen
0
281
Member Avatar for ~s.o.s~

[QUOTE=hbk619;424917]Just because I don't want to get married it means I can't love somone? Sheesh.[/QUOTE]An alternate take about shacking up is that you ain't got the stones to publicly state to all your family and friends that "this is it". That's one view of the ceremony. Another view is similar …

Member Avatar for Borzoi
0
726
Member Avatar for Nicanor

[QUOTE=Nicanor]Trying to compile a program, in my accounts.cpp I have 2 errorsp[quote]accounts.cpp:240: error: name lookup of `a' changed for new ISO `for' scoping accounts.cpp:234: error: using obsolete binding at `a'[/quote]here's the code [code]bool cAccount::IsOnline( int acctnum ) { if (acctnum < 0) return false; map<int, acctman_st>::iterator iter_acctman; if ((iter_acctman = …

Member Avatar for frogn8r
0
831
Member Avatar for happygeek

My name is Johnny and I'm a: [list][*]Politics/opinion/news geek [*]Nouveau blogging geek [*]Embedded systems geek[/list]

Member Avatar for Chatterbox721
0
758
Member Avatar for christina>you

[QUOTE=christina>you;429278]So most say that dictatorship is more efficient than democracy...[/QUOTE]Your questions seem like a homework assignment. For that I would refer you to Wikipedia, generally. If you care to be digging deeper, present a more focused question. (I claim a pass because I have presented a history of doing such …

Member Avatar for Future_Dictator
0
1K
Member Avatar for tyczj
Member Avatar for Asif_NSU

[code][color=darkgreen][b]#include[/b][/color] <stdio.h> [color=blue][b]void[/b][/color] [b][color=red]foo[/color][/b]([b][color=blue]int[/color][/b] n) { [b][color=blue]if[/color][/b] ( n >= [color=teal]0[/color] ) { [b][color=red]printf[/color][/b]([color=teal]"%d "[/color], n); [b][color=red]foo[/color][/b](n - [color=teal]1[/color]); } } [b][color=blue]void[/color] [color=red]bar[/color][/b]([b][color=blue]int[/color][/b] n) { [b][color=blue]if[/color][/b] ( n >= [color=teal]0[/color] ) { [b][color=red]bar[/color][/b](n - [color=teal]1[/color]); [b][color=red]printf[/color][/b]([color=teal]"%d "[/color], n); } } [b][color=blue]int[/color] [color=red]main[/color][/b]() { [b][color=blue]int[/color][/b] value = [color=teal]5[/color]; [b][color=red]foo[/color][/b](value); [b][color=red]putchar[/color][/b]([color=teal]'\n'[/color]); [b][color=red]bar[/color][/b](value); …

Member Avatar for rexel0924
1
215
Member Avatar for rocky2008
Member Avatar for surendra verma
0
177
Member Avatar for death_oclock

Possibly...?[code]typedef struct GROUP GROUP; [COLOR="Red"]/* assuming * was erroneous? */[/COLOR] typedef struct CHUNK CHUNK; [COLOR="Red"]/* assuming * was erroneous? */[/COLOR] [COLOR="Red"]typedef enum {false,true} bool;[/COLOR][/code]

Member Avatar for HHBones
0
222
Member Avatar for Pikachumanson
Member Avatar for vijayaustin
0
151
Member Avatar for complete

A search engine is usually a better place to start with such questions. [url]http://en.wikipedia.org/wiki/Design_pattern_(computer_science)[/url] [url]http://en.wikipedia.org/wiki/Design_Patterns[/url]

Member Avatar for Schol-R-LEA
0
149
Member Avatar for patito

[QUOTE=patito]hi crazydieter, i had a problem compiling the code again: C:/MINGW/BIN/../lib/gcc-lib/mingw32/3.2.2/../../../libstdc++.a(c++locale.o)(.tex t+0x3a0): undefined reference to `strtold'[/QUOTE] Maybe use [FONT=Courier New]strtod[/FONT] instead of [FONT=Courier New]strto[COLOR=Red]l[/COLOR]d[/FONT] and be sure to [FONT=Courier New]#include <cstdlib>[/FONT]. [QUOTE=patito]can you please mail me the binary? << moderator edit: removed email address >> thanks![/QUOTE]Please post questions and replies …

Member Avatar for RVNJIK
0
756
Member Avatar for crapodino

As it's a compile error, I might suspect that gcc has not been made aware of the include path.

Member Avatar for vinodhkumarvk
0
331
Member Avatar for jehdo

Doesn't [font=Courier New]new[/font] throw an execption instead of returning [font=Courier New]NULL[/font] unless you explicitly use '[font=Courier New]new(std::nothrow)[/font]'?

Member Avatar for Fbody
0
605
Member Avatar for iamboredguy

[QUOTE=iamboredguy]I don't get why C++ pros see red when they see [b]void[/b] main(). Can someone explain why [b]int[/b]main() is good and [b]void[/b] main() bad?[/QUOTE]In [url="http://www.daniweb.com/techtalkforums/showthread.php?p=46872&highlight=void+main+wrong#post46872"]this reply[/url], I posted 6 links to explanations of why it is considered wrong.

Member Avatar for sujitkumarsingh
1
854
Member Avatar for kloony

There is a bug in the code. You are fortunate that the UNIX platform at least shows you this; in Windows it is just "lucky" to be running.

Member Avatar for creeps
0
199
Member Avatar for Micko

[url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n897.pdf]Rationale[/url]:[quote]7.19.7.7 The gets function Because gets does not check for buffer overrun, it is generally unsafe to use when its input is not under the programmer’s control. This has caused some to question whether it should appear in the Standard at all. The Committee decided that gets was useful and …

Member Avatar for Narue
1
141
Member Avatar for evilsilver

Poor indentation strikes again! The function [FONT=Courier New]battle()[/FONT] appears to be missing a closing [FONT=Courier New]}[/FONT].

Member Avatar for az-zahra
0
377
Member Avatar for GMSI

The Turbo C I am most familiar with was designed to be used under DOS: preceding Windows 3.1, preceding Win95, preceding Win98, preceding Win2000, preceding WinXP. The huge hint to be taken here is that it is generally not appropriate for general use on a more modern OS, and this …

Member Avatar for Adak
0
776
Member Avatar for ROGENATOR

A [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046380353&id=1044780608]start[/url].

Member Avatar for prvnkmr449
0
206
Member Avatar for boyhenyo

[QUOTE=boyhenyo;448877]hi please help me....can you give me a code for queue program???[/QUOTE][URL="http://www.daniweb.com/forums/announcement8-2.html"]No[/URL].

Member Avatar for polisure
0
202
Member Avatar for Eager Student

[quote=Rob Pike]Rule 5. Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.[/quote]Have you begun to set up a data type? (And you may want to mention the language -- C or …

Member Avatar for diannetots
0
283
Member Avatar for cscotty

How about writing each question as a function. Have the function return 0 if they get it wrong or 1 if they get it right. Loop around each question-function until they get it right, then move to the next function-question.

Member Avatar for jack2423
0
517
Member Avatar for server_crash

[url]http://www.parashift.com/c++-faq-lite/private-inheritance.html[/url]

Member Avatar for brkurre
0
220
Member Avatar for terence193
Member Avatar for vegaseat
0
885
Member Avatar for Nathan Campos

[QUOTE=Nathan Campos;966424]As you can see in my previous posts i was trying to correct the only code snippet that i've founded in Google, but it's getting so much errors.[/QUOTE]I was able to build with no errors the code you posted. My IDE hides the feeding of the linker, but I …

Member Avatar for DevC+
0
190
Member Avatar for coolmel55

Loop through all array elements and compare each element; if all elements are the same, consider the arrays equal. Or use [url="http://www.rt.com/man/memcmp.3.html"][font=Courier New]memcmp[/font][/url], which essentially does this.

Member Avatar for arkoenig
0
306
Member Avatar for Dave Sinkula

This code uses a structure to map a letter to an equivalent representation of Morse code. It simply loops through either a string to encode or decode looking for text to substitute with a replacement string or character. Output is presented to the stdout.

Member Avatar for Quagmire232
0
377

The End.