2,384 Posted Topics

Member Avatar for numerouno543

What compiler/OS? There will probably be documentation provided with your system. There may be something like [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dns/dns/dnsquery.asp]this[/url] for Windows, or [url=http://www.rt.com/man/dig.1.html]this[/url] for Linux.

Member Avatar for numerouno543
0
164
Member Avatar for Jaguar

[url=http://en.wikipedia.org/wiki/Flowchart]Flowchart[/url], [url=http://en.wikipedia.org/wiki/Pseudo_code]pseudo code[/url]; more of a paper-and-pencil exercise, but if you can capture an image, [url]http://imageshack.us/[/url] can be useful for posting what you have.

Member Avatar for Dave Sinkula
0
99
Member Avatar for somer2412

[code]char state;[/code]The above is only a single character, not a string. [code]if ( state == "AL" || "Al" || "al")[/code]The above is equivalent to the following, which is not what you want. [code]if ( state == [COLOR=Red]([/COLOR]"AL" || "Al" || "al"[COLOR=Red])[/COLOR])[/code]Besides, to compare C-style strings, you use [FONT=Courier New]strcmp[/FONT]. If …

Member Avatar for Dave Sinkula
0
200
Member Avatar for Dave Sinkula

These are my bookmarked links to various forums I regularly visit:[list][*][url]http://cboard.cprogramming.com/forumdisplay.php?s=&forumid=4[/url] [*][url]http://www.daniweb.com/techtalkforums/forumdisplay.php?s=&daysprune=&f=8[/url] [*][url]http://forums.devshed.com/f42/s[/url] [*][url]http://www.gidforums.com/f-28.html[/url] [*][url]http://www.tek-tips.com/threadminder.cfm?pid=205[/url] [*][url]http://www.cppworld.com/[/url][/list]What are yours?

Member Avatar for Dogtree
0
165
Member Avatar for letmec

It looks like you are trying to make some old Borland code for DOS. Perhaps there are some examples in the Code Snippets.

Member Avatar for Asif_NSU
0
123
Member Avatar for Marack

Where there is repetition, try to separate the common code. For example,[code] cout<<"Enter your selection please..."; cin>>c; cout<<"Enter the number of dice to roll..."; cin>>n; cout<<"in groups of how many? "; cin>>g; if ( c == 1 ) { D4(n,4); } else if ( c == 2 ) { D4(n,6); …

Member Avatar for andor
0
128
Member Avatar for JoBe

How about this?[code]while ( cin >> x >> y )[/code]What is an example of your input?

Member Avatar for JoBe
0
592
Member Avatar for evil_dude_01

[code]#include <iostream> #include <string> using namespace std; int main(void) { string text; do { cout << "prompt: "; getline(cin, text); } while ( text[0] == '\0' ); cout << "text = " << text << endl; return 0; } /* my output prompt: prompt: prompt: prompt: hello world text = …

Member Avatar for evil_dude_01
0
189
Member Avatar for xplicit

Doesn't a Packaging Wizard come with MSVC7? Or did [url=http://www.jrsoftware.org/isinfo.php]Inno Setup[/url]'s stuff do that kinda thing too? I forget.

Member Avatar for xplicit
0
148
Member Avatar for Asif_NSU

I believe the [url=http://www.boost.org/libs/regex/doc/index.html]boost regex[/url] is frequently recommended.

Member Avatar for Dogtree
0
146
Member Avatar for gimmy

There is no function because there is no need for one. What you see is how you choose to interpret it. [code]#include <stdio.h> int main(void) { char ch = '*'; printf("ch = '%c'\n", ch); printf("ch = %d\n", ch); return 0; } /* my output ch = '*' ch = 42 …

Member Avatar for Dave Sinkula
0
135
Member Avatar for CryingRaven

First, why are you using the [FONT=Courier New]#include [COLOR=Red]<[/COLOR]header.h[COLOR=Red]>[/COLOR][/FONT] variation? That is generally used for system headers. User headers are generally [FONT=Courier New]#include [COLOR=Blue]"[/COLOR]header.h[COLOR=Blue]"[/COLOR][/FONT]. It makes a difference in where it looks for the files. Second, are you setting up the project correctly for multiple source files? It ought to …

Member Avatar for Dave Sinkula
0
329
Member Avatar for a7la_lolly

Maybe try searching the [url=http://www.daniweb.com/code/c.html]Code Snippets[/url].

Member Avatar for Dave Sinkula
0
122
Member Avatar for winbatch

I'm not familiar with the libraries you are working with, but perhaps the "'non native', ie like a 'string', or 'vector'" issue is because they are not POD types?

Member Avatar for Dogtree
0
511
Member Avatar for winbatch
Member Avatar for Dogtree
0
256
Member Avatar for Electrohead

[url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385[/url]

Member Avatar for Electrohead
0
278
Member Avatar for madt

Why don't you use the parameterized constructor? [code]int main() { int d; int b; cout << "Enter number in decimal and the Base to Convert: "; cin >> d >> b; cout << endl; [COLOR=Blue]baseType myBase(d,b);[/COLOR] myBase.decToBase(d, b); myBase.print(); return 0; }[/code]

Member Avatar for madt
0
92
Member Avatar for maherddd

It's late and I'm tired, so here's a [url=http://www.cppworld.com/forum/index.php?showtopic=474&st=0&#entry3390]gift[/url]. Try working it into something of your own and post any problems you are having. Also, read the [URL=http://www.daniweb.com/techtalkforums/announcement8-2.html]Announcement[/URL]. .

Member Avatar for Dave Sinkula
0
200
Member Avatar for typek

[url]http://www.thefreecountry.com/programming/resourceeditors.shtml[/url]?

Member Avatar for typek
0
147
Member Avatar for Acidburn
Member Avatar for madt

>but am getting the wrong output Could you be more precise? [url]http://www.catb.org/~esr/faqs/smart-questions.html#beprecise[/url] What is your input? What is your output that is "wrong"? What are a and b?

Member Avatar for Dave Sinkula
0
260
Member Avatar for skprasat

[code] double a=123.456; char msg1[3]; sprintf(msg1,"%g",a);[/code]The string [FONT=Courier New]msg1[/FONT] only has room for 2 characters and a terminating null. And you're trying to write 7 characters plus the null to it. [code]send(sockfd2,msg1,[COLOR=Red]sizeof[/COLOR](msg1),0);[/code]You might mean [FONT=Courier New]strlen(msg1)[/FONT].

Member Avatar for Dave Sinkula
0
273
Member Avatar for hazzo

[QUOTE=hazzo]Will not work It comes up with the error message "Line 11 `main' must"[/QUOTE]...have return type [FONT=Courier New]int[/FONT]? [QUOTE=hazzo]How do i fix this[/QUOTE]Uh, give [FONT=Courier New]main[/FONT] a return type of [FONT=Courier New]int[/FONT]. [code]int main() { // ... return 0; }[/code]

Member Avatar for vegaseat
0
127
Member Avatar for indianscorpion2

C is commonly used for [url=http://en.wikipedia.org/wiki/Embedded_system]embedded systems[/url].

Member Avatar for letmec
0
184
Member Avatar for amsnme

[quote=amsnme]hi....can anyone pliz tell me how to go about converting numbers to letters on a telephone keypad...... eg when we txt..and suppose we type in 4663,we can get hood,home,good,gone....etc...[/quote]The code you posted seems to be going the other way -- from "home" to 4663.

Member Avatar for Dave Sinkula
0
211
Member Avatar for calibill
Re: Help

Since you read the [url=http://www.daniweb.com/techtalkforums/announcement8-2.html]Announcement[/url], what code are you having trouble with?

Member Avatar for Dave Sinkula
0
183
Member Avatar for Shadow13

Let sleeping threads lie. Instead, refer to them in a new thread. Split thread: refer to this previous thread: [thread]12479[/thread]

Member Avatar for Dave Sinkula
0
72
Member Avatar for Prahaai

Something like this? [code]#include <iostream> #include <cstdlib> #include <ctime> [COLOR=Blue]int foo(double percent) { double number = std::rand() / (double)RAND_MAX; /* value from [0,1] */ return number < percent; }[/COLOR] int main() { std::srand(std::time(0)); double pct = 0.1; for ( int i = 0; i < 10; ++i ) { std::cout …

Member Avatar for Dave Sinkula
0
268
Member Avatar for madt

>my question is how do you store a fraction such as 2/3 into cin>> ? This is one way. [code]#include <iostream> int main() { char slash; int x, y; std::cout << "fraction? "; if ( std::cin >> x && std::cin >> slash && std::cin >> y ) { std::cout << …

Member Avatar for Dave Sinkula
0
273
Member Avatar for winbatch

[QUOTE=winbatch]And the wonderfully succint error:[/QUOTE][url]http://www.bdsoft.com/tools/stlfilt.html[/url]

Member Avatar for winbatch
0
694
Member Avatar for usausa

Why not a [FONT=Courier New]vector[/FONT] of [FONT=Courier New]string[/FONT]s?

Member Avatar for Dogtree
0
134
Member Avatar for letmec

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

Member Avatar for Dave Sinkula
0
89
Member Avatar for missdiva
Member Avatar for Dave Sinkula
0
85
Member Avatar for sinB

Is DOS your OS? If not, you may want to learn a graphics API for your platform.

Member Avatar for Dave Sinkula
0
68
Member Avatar for usausa

In another forum I posted a link to an FAQ: "Accessing a directory and all the files within it". Did you follow the link?

Member Avatar for vegaseat
0
460
Member Avatar for Prahaai

[QUOTE=Prahaai]i cant really understand how i use it... i am quite confused, sorry, i am not that good to understand where exactly i put the name of the file i have to read? And i dont understand why you put that (argc == 2)... :cry: [/QUOTE]From the command line.[code]#include <iostream> …

Member Avatar for Dave Sinkula
0
220
Member Avatar for dejaz

I'd imagine something like... [code]double prof[COLOR=Blue] = 0[/COLOR]; // ... while(/*...*/) { [COLOR=Blue]double p = profits(ssg.prodprice, ssg.prodcost, ssg.prodquan);[/COLOR] // ... [COLOR=Blue]prof += p;[/COLOR] }[/code]

Member Avatar for dejaz
0
249
Member Avatar for Tetsu

[code]000013 Farsio Kottab E [COLOR=Red]90013[/COLOR] CA 90755 40 20.00[/code]This gets you into a fail state.

Member Avatar for Tetsu
0
472
Member Avatar for cspikes

Please read the [URL=http://www.daniweb.com/techtalkforums/announcement8-2.html]Announcement[/URL].

Member Avatar for Dogtree
0
139
Member Avatar for t3bruce

[QUOTE=t3bruce][code]using dice std; # include <cstdlib> int dice( ) { int. random_ interger = rand ( ) cout << random_ interger << end 1 }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][co[u][/u]de][/co[u][/u]de][/url] tags >> . Write the member function definitions for each function listed: 1. Object Type: a pair of dice Knows: The …

Member Avatar for Dave Sinkula
0
180
Member Avatar for tat2dlady

With [FONT=Fixedsys]strcmp[/FONT]. The result would be less or greater than zero.[code]#include <stdio.h> #include <string.h> int main(void) { static const char a[] = "12345620", b[] = "123456708"; int result = strcmp(a, b); printf("%s %s %s\n", a, result < 0 ? "<" : result > 0 ? ">" : "=", b); return …

Member Avatar for Dogtree
0
1K
Member Avatar for idris
Member Avatar for ross_player1

Please post code within code tags. Might [this](url=http://www.daniweb.com/code/snippet258.html) help?

Member Avatar for ross_player1
0
135
Member Avatar for Scuuba

[code]#include <[COLOR=Red]c[/COLOR]string>[/code]I think you meant this one.[code]#include <string>[/code]

Member Avatar for Scuuba
0
173
Member Avatar for Acidburn

This important part looks like it got lost. [code] while ( game1.getlives() != 0 [COLOR=Blue]&& game1.checkstatus()[/COLOR] )[/code] This is how I might write [FONT=Courier New]checkstatus[/FONT]. [code]int hangman::checkstatus() { int i; for ( i = 0; encryption[i] != '\0'; ++i ) { if ( encryption[i] == '*' ) { return 1; …

Member Avatar for Dave Sinkula
0
185
Member Avatar for nizar4445

[QUOTE=nizar4445]i know i have to use feof with a while loop[/QUOTE]Uh-oh. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351[/url]

Member Avatar for nizar4445
0
271
Member Avatar for rohitmc

Arrays are indexed [FONT=Courier New]a[COLOR=Blue][[/COLOR]i[COLOR=Blue]][/COLOR][/FONT], not [FONT=Courier New]a[COLOR=Red]([/COLOR]i[COLOR=Red])[/COLOR][/FONT].[code]a [COLOR=Red]*[/COLOR] new int[num_cells];[/code]Typo?[code]a [COLOR=Blue]=[/COLOR] new int[num_cells];[/code][code]int=b;[/code]Did you mean [FONT=Courier New]i[/FONT] instead of [FONT=Courier New]int[/FONT]?[code]b=nul;[/code][FONT=Courier New]b[/FONT]? [FONT=Courier New]nul[/FONT]? Learn to use whitespace to make your code easier to read.

Member Avatar for rohitmc
0
203
Member Avatar for nathanj99

I am not familiar with [FONT=Courier New]AnsiString[/FONT], so I'd recommend reading the documentation your implementation provides. Some Googling suggests that there are methods [FONT=Courier New]c_str()[/FONT] and [FONT=Courier New]Length()[/FONT] that may be of use. [url]http://www.functionx.com/bcb/topics/strings.htm[/url]

Member Avatar for Narue
0
310
Member Avatar for peter_budo
Member Avatar for peter_budo
0
215
Member Avatar for tyczj

>what is the header to time code isnt it; I cannot quite parse what you are saying. >#include "pctimer.h" >i keep gettin an error saying no such thing Unless you've created it, this is true. Are you looking for [FONT=Fixedsys]time.h[/FONT]/[FONT=Fixedsys]ctime[/FONT]?

Member Avatar for tyczj
0
284

The End.