Posts
 
Reputation
Joined
Last Seen
Ranked #16
Strength to Increase Rep
+18
Strength to Decrease Rep
-4
90% Quality Score
Upvotes Received
571
Posts with Upvotes
421
Upvoting Members
170
Downvotes Received
52
Posts with Downvotes
33
Downvoting Members
37
278 Commented Posts
~1.35M People Reached
Favorite Tags

2,384 Posted Topics

Member Avatar for ndeniche

[URL="http://www.minerals.net/mineral/oxides/corundum/corundum.htm"]Corundum[/URL]?

Member Avatar for Reverend Jim
1
482
Member Avatar for Duki
Member Avatar for comwizz

[inlinecode]getchar[/inlinecode] This is a standard function that gets a character from the stdin. [inlinecode]getch[/inlinecode] This is a nonstandard function that gets a character from keyboard, does not echo to screen. [inlinecode]getche[/inlinecode] This is a nonstandard function that gets a character from the keyboard, echoes to screen. Use [inlinecode]getchar[/inlinecode] if you …

Member Avatar for Smartfitness33
1
5K
Member Avatar for Demetrius

C and C++ do not have built-in standard support for sound. You will need to mention your compiler and OS and look into sound libraries.

Member Avatar for k191376
0
15K
Member Avatar for kanebt

[QUOTE=happygeek;594777]There is no option to delete an account because doing so, and removing postings associated with that deleted account, would create huge holes in the DaniWeb database - support threads would become meaningless. You can, however, unsubscribe to admin emails and posting notifications etc via the control panel, and then …

Member Avatar for Олег_9
3
3K
Member Avatar for DemonLady

[QUOTE=DemonLady]I got this assignment and I'm stuck. I have to write a function that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the function should return 1367. Can someone help? :confused:[/QUOTE]This question gets asked about once a week on a …

Member Avatar for Ajini
0
3K
Member Avatar for Aild

In addition to the declaration issues jesseb07 pointed out, I think you've still got indexing issues with the [ICODE]m[/ICODE] and [ICODE]n[/ICODE] loops that also increment [ICODE]a[/ICODE] and [ICODE]b[/ICODE]. [edit]Maybe reset [ICODE]b[/ICODE]? [code] a = i-1; for ( m = 0; m < 3; m++, a++ ) { [COLOR="Red"]b = j-1;[/COLOR] …

Member Avatar for Andy_20
0
13K
Member Avatar for pavankumar77
Member Avatar for Dave Sinkula

Many times [inlinecode]strtok[/inlinecode] is recommended for parsing a string; I don't care for [inlinecode]strtok[/inlinecode]. Why? [list][*]It modifies the incoming string, so it cannot be used with string literals or other constant strings. [*]The identity of the delimiting character is lost. [*]It uses a static buffer while parsing, so it's not …

Member Avatar for anti_neoliberal
0
10K
Member Avatar for vegaseat
Member Avatar for Dave Sinkula

With regard to C++ books, I'll just echo the advice here .The following books are recommended; read them in mostly the order listed." Accelerated C++ " Andrew Koenig & Barbara Moo " The C++ Standard Library " Nicolai Josuttis --- a "must have" " Effective C++ ", " More Effective …

Member Avatar for shahidali6
11
10K
Member Avatar for ~s.o.s~

Some links I've had lying around (I haven't visited some of these in quite some time -- take note): [B]Tutorials[/B]:[list][*][url=http://cprog.tomsweb.net/cintro.html]An introduction to C[/url] [*][url=http://www.its.strath.ac.uk/courses/c/]C Programming[/url] [*][url=http://www.cs.cf.ac.uk/Dave/C/]Programming in C - UNIX System Calls and Subroutines using C[/url][/list] [B]References[/B]:[list][*][url=http://www.weycrest.co.uk/information/infosec/info/programming/C_Ref_Card.pdf]C Reference Card (ANSI)[/url] [*][url=http://www-ccs.ucsd.edu/c/]Standard C[/url] [*][url=http://www.swansontec.com/sopc.htm]C Language Operator Precedence Chart[/url] [*][url=http://www.acm.uiuc.edu/webmonkeys/book/c_guide/]The C Library …

Member Avatar for mack1
29
5K
Member Avatar for William Hemsworth

Issues when building with mingw: [QUOTE][COLOR="Red"]main.cpp:12: error: ISO C++ prohibits anonymous structs[/COLOR] main.cpp: In function `void onFrame(pixel*)': main.cpp:60: error: expected primary-expression before "unsigned" main.cpp:60: error: expected `;' before "unsigned" main.cpp: In function `void MakeSurface(HWND__*)': main.cpp:134: warning: passing NULL used for non-pointer converting 2 of `void* CreateThread(_SECURITY_ATTRIBUTES*, DWORD, DWORD (*)(void*), void*, …

Member Avatar for thetukiet
1
7K
Member Avatar for AJones

[QUOTE=AJones;245832]It just does not read iostream.h file.[/QUOTE]*Ahem* Don't [INLINECODE]#include <iostream[COLOR="Magenta"].h[/COLOR]>[/INLINECODE]. Do [INLINECODE]#include <iostream>[/INLINECODE], and you then should be [INLINECODE]using namespace std;[/INLINECODE]. I believe this was mentioned already. Post [U]exactly[/U] the code you are using -- subtle typos CAN make a difference.

Member Avatar for Wajid sardar
0
2K
Member Avatar for bops

Is C:\Dev-Cpp\bin in your path?[quote]C:\Test\GnuC>path PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C;\icc\bin;[COLOR=Blue]C:\Dev-Cpp\bin[/COLOR];C:\BC5\BIN;C:\watcom\BINNT;C:\watcom\BINW;c:\Perl\bin;C:\Program Files\ActiveState Komodo 3.1\;C:\Program Files\Common Files\GTK\2.0\bin;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Autodesk\DWG TrueView\;..\tool;C:\Program Files\doxygen\bin;C:\Program Files\Subversion\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\Program Files\Microsoft Visual Studio\Common\IDE\IDE98;C:\Program Files\vslick\win;C:\NECTOOLS\BIN;..\tool;C:\COSMIC\EVAL08;c:\nectools32\bin; [/quote]

Member Avatar for muhammad raees
0
29K
Member Avatar for makan007

[QUOTE=makan007;1116352]I want count the elements in a srand generated array.[/QUOTE] For me, the basic premise is lacking. You don't need to count the members of an array because you know how many elements it has when you declare it. Or if it is dynamic, you know how many elements when …

Member Avatar for TalhaMoazSarwar
0
887
Member Avatar for debasisdas

:)[QUOTE="Ronald Reagan"]Politics I supposed to be the second-oldest profession. I have come to realize that it bears a very close resemblance to the first.[/QUOTE]

Member Avatar for James_28
8
17K
Member Avatar for taverasme

[QUOTE=gerard4143;1105029]Try something like below:[/QUOTE] With the MinGW version of gcc: [QUOTE]main.c main.c: In function `main': main.c:18: warning: implicit declaration of function `getline' Linking... Debug/main.o: In function `main': C:/Users/Dave/Projects/scratch/main.c:18: undefined reference to `_getline' collect2: ld returned 1 exit status *** Errors occurred during this build *** [/QUOTE] [QUOTE=taverasme;1104994]I need to write …

Member Avatar for Nikolas9896
0
6K
Member Avatar for lara_

[QUOTE=Asif_NSU]i would really love to know if there's any other way to get the functionality of getch()(i.e without using getch()) in the above mentioned cases.[/QUOTE]The problem with unbuffered input is that it becomes the responsibility of the programmer to handle the buffering. Do you allow the user to make a …

Member Avatar for nootan.ghimire_1
0
7K
Member Avatar for vegaseat

This is a [URL="http://c-faq.com/stdio/stdinflush.html"]no-no[/URL]: [code]fflush(stdin);[/code] And scanf with [ICODE]%s[/ICODE] could be done better or [URL="http://c-faq.com/stdio/scanfprobs.html"]avoided[/URL]. [CODE]scanf("%s",person->name);[/CODE] [url]http://www.daniweb.com/tutorials/tutorial45806.html[/url]

Member Avatar for Ancient Dragon
1
470
Member Avatar for mariners95

Wonderful! Be a pompous ass and dredge up an old thread (after reiterating the same demand a 3rd time), offering nothing, and pretend you are being courteous! Well, done. *plonk*

Member Avatar for johnnew
0
400
Member Avatar for policeachan

They're found in the source code of a language implementation. That is, Borland C/C++, Microsoft Visual C++, Dev-C++, gnu, etc. (And the implementation of the C or C++ language may itself not be in C or C++.) What you get when you use C or C++ is a defined interface …

Member Avatar for Nishant_2
0
1K
Member Avatar for sargarpramod

> #include<stdio.h> > int main () > { > [COLOR="Red"]char x; [/COLOR] > printf("\nEnter a Character : "); > [COLOR="Red"]x = getchar();[/COLOR] > printf("\nThe ASCII for Char is: %d",x); > return 0;/*** was avoiding this line ****/ > } Since `getchar` returns an `int`, `x` should be an `int`. This …

Member Avatar for tilakkumar
0
3K
Member Avatar for Dave Sinkula

Finding some text and replacing it with new text within a C string can be a little trickier than expected. Here is what I had come up with one day.

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

I thought that one was: "Thou shalt not comfort thy rod with thy staff."

Member Avatar for Ene Uran
9
4K
Member Avatar for ndeniche
Member Avatar for ndeniche
Member Avatar for GrimJack
0
2K
Member Avatar for Lardmeister

I looked into it when one of my radio talk show host got on the topic a while back. I have a new date to be interested in. I'm looking forward to subsequent shows on TV and radio.

Member Avatar for sneekula
2
2K
Member Avatar for animesh

This is one way. [CODE] [color=darkgreen][b]#include[/b][/color] <iostream> [color=darkgreen][b]#include[/b][/color] <ctime> [b][color=blue]int[/color][/b] [b][color=red]main[/color][/b]() { [b][color=blue] struct[/color][/b] [color=#4b0082]std[/color]::[color=indigo]tm[/color] a = {[color=teal]0[/color],[color=teal]0[/color],[color=teal]0[/color],[color=teal]24[/color],[color=teal]5[/color],[color=teal]104[/color]}; [color=orange]/* June 24, 2004 */[/color] [b][color=blue] struct[/color][/b] [color=#4b0082]std[/color]::[color=indigo]tm[/color] b = {[color=teal]0[/color],[color=teal]0[/color],[color=teal]0[/color],[color=teal]5[/color],[color=teal]6[/color],[color=teal]104[/color]}; [color=orange]/* July 5, 2004 */[/color] [color=#4b0082] std[/color]::[color=indigo]time_t[/color] x = [color=#4b0082]std[/color]::[b][color=red]mktime[/color][/b](&a); [color=#4b0082] std[/color]::[color=indigo]time_t[/color] y = [color=#4b0082]std[/color]::[b][color=red]mktime[/color][/b](&b); [b][color=blue] if [/color][/b]( x != ([color=#4b0082]std[/color]::[color=indigo]time_t[/color])([color=teal]-1[/color]) …

Member Avatar for deceptikon
0
3K
Member Avatar for Asif_NSU

I can't see your computer, but it sounds like you have a missing source file in your project list. [URL=http://img140.exs.cx/my.php?loc=img140&image=devc3ft.gif][IMG]http://img140.exs.cx/img140/3929/devc3ft.th.gif[/IMG][/URL] You may need to add the file containing the definition the linker needs. [URL=http://img140.exs.cx/my.php?loc=img140&image=devc29xk.gif][IMG]http://img140.exs.cx/img140/7249/devc29xk.th.gif[/IMG][/URL] [quote=Asif_NSU]I just had a glance at how to write makefiles. Looks messy[/quote]Yeah, makefiles are their own …

Member Avatar for Musa_Jutt
0
3K
Member Avatar for abd2

Did you save it or did it automatically save after entering the 3 lines? [And next time, try to put your code between CODE tags]

Member Avatar for kimchong
2
2K
Member Avatar for gtsreddy
Member Avatar for vijayan121
0
718
Member Avatar for cortiknee

[QUOTE=Stack Overflow]This process is not hard since the default libraries included a function to do this. It's called itoa().[/QUOTE]And [font=Courier New]itoa[/font] is nonstandard. A standard function is [font=Courier New]sprintf[/font].[code]#include <stdio.h> int main(void) { const char base[] = "filename"; char filename [ FILENAME_MAX ]; int number = 42; [color=Blue]sprintf(filename, "%s%d", base, …

Member Avatar for dverex
2
15K
Member Avatar for Azurea
Member Avatar for WaltP
0
617
Member Avatar for Ghost

[QUOTE=C++]I think the answer is: void divide(int numerator,int denominator,int* quotient, int* remainder){ *(quotient=[color=Red]&[/color]numerator/[color=Red]&[/color]denominator); *(remainder=[color=Red]&[/color]denominator%[color=Red]&[/color]numerator); }[/QUOTE]Divide [i]values[/i], not [i]memory locations[/i]:[code]#include <stdio.h> void divide(int numerator, int denominator, int* quotient, int* remainder) { *quotient = numerator / denominator; *remainder = denominator % numerator; } int main(void) { int numerator=42, denominator=5, quotient, remainder; divide(numerator,denominator,&quotient,&remainder); …

Member Avatar for wangchung
0
961
Member Avatar for tux4life

Here's a better idea for the return value: return an explicit value instead of allowing the possibility of signed integer overflow?

Member Avatar for ibykow
0
695
Member Avatar for allomeen

I find the diagnostic message quite self-explanitory.[quote]declaration of `c' as multidimensional array must have bounds for all dimensions except the first[/quote]You can't do [FONT=Courier New][][][/FONT]. You can do [FONT=Courier New][][5][/FONT], for example.

Member Avatar for deceptikon
1
848
Member Avatar for vegaseat

test.c 11 error [Warning 603] Symbol 'bin' (line 8) not initialized test.c 14 error [Warning 534] Ignoring return value of function 'gets(char *)' test.c 14 error [Warning 421] Caution -- function 'gets(char *)' is considered dangerous test.c 17 error [Info 725] Expected positive indentation from line 16 test.c 19 error …

Member Avatar for soorajshaji
0
2K
Member Avatar for Dave Sinkula

While not terribly difficult, first timers may not know the functions to look up and use. Here is some basic code for reading a file one line at a time. The contents of the file are printed to the stdout.

Member Avatar for 'CoffeeLike
2
61K
Member Avatar for dile
Member Avatar for cessna172

Have you ever heard of "debugging with printf"? A similar thing can be done with cout as well. You pepper this code with statements that display for you any items of interest while the program is running. It's a good way to see for yourself what is going on in …

Member Avatar for mrnutty
0
2K
Member Avatar for djextazy

An array of size N will be indexed from 0 to N-1. The standard idiomatic for loop is then like this: [CODE]for ( int i = [color=Blue]0[/color]; i [color=Blue]<[/color] N; ++i )[/CODE]

Member Avatar for hust921
0
208
Member Avatar for kaoss1103

Not necessarily. You could just remove this line and run the program from a command shell. Or use a standard method of pausing such as [FONT=Courier New]cin.get[/FONT].

Member Avatar for v3ga
1
2K
Member Avatar for axiss

[QUOTE=cscgal]iamthwee, DaniWeb actually has built-in Tex functionality by using the tex bbcode. There is no need to hotlink tex from an image upload service [tex]iamthwee=x^2[/tex][/QUOTE]Does it work for you? It doesn't appear to work for me. [tex]y=x^2[/tex] [quote][Unparseable or potentially dangerous latex formula. Error 4 ][/quote]

Member Avatar for ynikitenko
0
280
Member Avatar for xxunknown321

I'd just read all lines of the file into a circular buffer with 10 strings, each containing a line. When you get to the end of the file, you will have the last 10 lines stored. [code]#include <iostream> using std::cout; #include <fstream> using std::ifstream; #include <string> using std::string; using std::getline; …

Member Avatar for usustarr
0
8K
Member Avatar for cyberguy007
Member Avatar for sanof3322
0
30K
Member Avatar for reuben12

You may want to try [font=Courier New]fgets[/font]/[font=Courier New]sscanf[/font]. Maybe something like this.[code]#include <stdio.h> int main(void) { const char filename[] = "file.txt"; FILE *file = fopen(filename, "r"); if ( file ) { char line [ BUFSIZ ]; while ( fgets(line, sizeof line, file) ) { char substr[32], *ptr = line; int …

Member Avatar for maaroufi
1
2K
Member Avatar for GrimJack

[URL="http://www.outsidethebeltway.com/archives/posse_comitatus_its_a_stupid_law_anyways/"]Posse Comitatus? Its a Stupid Law Anyways[/URL]

Member Avatar for Netcode
0
601
Member Avatar for ekvenkatesh

It's not a syntax issue, since it compile; it is a runtime issue in which you allow your code to do something it is not supposed to do. In particular it happens to indicate that the issue involves something you may have attempted to do involving floating point. Without posting …

Member Avatar for nightcrew
0
2K
Member Avatar for Phaelax

Try it with a dynamic array and find out you are wrong. You are being helpfully corrected, you are the one starting to get out of line.

Member Avatar for Diego.Corso
0
27K

The End.