5,676 Posted Topics

Member Avatar for yandidaim
Member Avatar for Sabi_146
Member Avatar for muadh jamal

[QUOTE=qaisu;339924] now if you want to give a range you can do it by this syntax (minimum+rand())%maximum; for example if you want to generate the numbers between 1 and 10,000 simply do it this way (1+rand())%10000; [/QUOTE] Not quite. it's [INLINECODE]minimum + (rand() % maximum);[/INLINECODE]

Member Avatar for WaltP
0
3K
Member Avatar for RisTar

A couple other things. See [url=http://www.gidnetwork.com/b-56.html]this about gets()[/url]. See [url=http://www.gidnetwork.com/b-38.html]this about formatting[/url]. You need indentation and whitespace. After you read the first character, then read the rest of the line, the rest of the line does not contain the first character. so the compare never works. Why not just use …

Member Avatar for WaltP
0
115
Member Avatar for Senel

[QUOTE=Senel;340245]any hint on each question how to begin with... i have exams tomorrow ><[/QUOTE] Better late than never, eh? ;) Hints? OK: [QUOTE=Senel;340233]Q1)Write a program that read two integer and determined and prints if the first is a multiple of the second? {Hint: Use the modulus operator.} ?[/QUOTE]Read about the …

Member Avatar for Aia
0
1K
Member Avatar for nottoshabi

Or: [code=cplusplus] int main() { int rtn; ... if (Get( cin, d1, d2, d3, d4, d5)&& Valid( d1, d2, d3, d4, d5 )) { cout << "The code has been vaildated" << endl; rtn = 0; } else { cout << "The code is invalid"; rtn = 1; } getchar(); …

Member Avatar for ~s.o.s~
0
107
Member Avatar for dcc
Member Avatar for nathanpacker

VB Script [I]is[/I] for html pages. You might want actual VB programs, which is harder. What is it you want to do? There may be something better out there for you.

Member Avatar for nathanpacker
0
67
Member Avatar for MarzenaM

Two options: #1) [B]Lerner[/B]'s idea will work well #2) Input the number as a string of characters. If you input [B]3157[/B], you wil have a string with '3','1','5','7'. Each character is then converted to an integer by subtracting '0', or 48.

Member Avatar for MarzenaM
0
107
Member Avatar for aparnesh
Member Avatar for CRD

Open the header file in an editor and take a look? Or cheat and look [url=http://www.dinkumware.com/manuals/?manual=compleat&page=index.html]here[/url] :)

Member Avatar for CRD
0
72
Member Avatar for satish.paluvai

[QUOTE=Aia;339521][QUOTE=Ancient Dragon;339460]you can read the novel War And Peace between compiles.[/QUOTE] Good one :). Not only do programming work but also you get educated in literacy.[/QUOTE] Hmmm. I read the comic pages. Should I change? [QUOTE=~s.o.s~;339427]Psst..don't let Walter hear this. He can infract you, you know. :D[/QUOTE] Who's [B]Walter[/B]:?:

Member Avatar for ~s.o.s~
0
109
Member Avatar for adnichols

[QUOTE=vijayan121;339279]u ... u ... u ... u ...[/QUOTE] :confused: [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_clean]Read this[/url] please.

Member Avatar for adnichols
0
134
Member Avatar for zana
Re: help

[url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized] Read this[/url]

Member Avatar for WaltP
0
32
Member Avatar for mathgirl

All you're trying to do is output the values in order. That's not a sort. Check if [b]x > y[/b]. If so, move [b]x[/b] into [b]y[/b] and [b]y[/b] into [b]x[/b] (switch the values). Then do it again for [b]y[/b] and [b]z[/b]. You'll have to go back and retest [b]x[/b] and …

Member Avatar for WaltP
0
154
Member Avatar for wujianwei

[QUOTE=iamthwee;339285]I don't think that would work.[/QUOTE] [QUOTE=Queatrix;339287]Why not?[/QUOTE] Agree. If you're going to complain about something, the least you can do is give [I]some[/I] kind of explanation.

Member Avatar for WaltP
0
97
Member Avatar for The Dude

[QUOTE=The Dude;337671]Everyone viewing this thread [b]PLEASE SIGN THE PETITION[/b] (Even if you live outside the USA -- We would do it for you if your country was @ risk of losing something so loved)[/QUOTE] And get the petition thrown out because of 'petition tampering'? Only US residents should sign it. …

Member Avatar for christina>you
0
92
Member Avatar for teh_man

[QUOTE=teh_man;336831]Hey All i am making a connect four game. I have done most of the code but need help in some bits 1) Which is how to code to see if there a win from vertical, horizontal or diagonal. - The Grid is 7 by 7. - I no idea …

Member Avatar for Lerner
0
134
Member Avatar for 7arouf

See [url=http://www.gidnetwork.com/b-61.html]this[/url] about [INLINECODE]system("pause");[/INLINECODE] [INLINECODE]system("cls");[/INLINECODE] is conceptually similar.

Member Avatar for Lance Wassing
0
562
Member Avatar for Duki

[QUOTE=ft3ssgeek;338428]As for part 1, I believe the instructions are referring to c-strings...how much do you know about c-strings?[/QUOTE] I don't think so. Although, I don't know what the instructions mean, either. Can you give us an example of the operation?

Member Avatar for Duki
0
583
Member Avatar for waeelahmed

Contact hit company [URL]http://www.hitcorporation.com/[/URL] and ask them how to interface with their modale MP200.

Member Avatar for WaltP
0
36
Member Avatar for ntredame

[QUOTE=vijayan121;338745]since we are using std::string, why not [code] #include <iostream> #include <string> using namespace std; int main() { string str ; cin >> str ; const string vowels = "aeiouAEIOU" ; int n_vowels = 0 ; for( string::size_type pos = str.find_first_of(vowels) ; pos != string::npos ; pos = str.find_first_of(vowels,pos+1) ) …

Member Avatar for ntredame
0
4K
Member Avatar for Matt Tacular

[QUOTE=7arouf;338735]i have no idea i hope sombody will help[/QUOTE] Two people already have -- [B]Wolfie[/B] directly answering your question, [B]SOS[/B] explaining something you need to understand. And here's a third: TTT is played on a 3x3 grid, therefore you should consider using a 3x3 array (matrix), like [INLINECODE]char grid[3][3][/INLINECODE]

Member Avatar for WaltP
0
97
Member Avatar for guy40az

[QUOTE=guy40az;337121]Well I am using VC 6.0 because it was given to me to learn c++.[/QUOTE] And it's fine for learning C++. It follows enough of the standard that you won't have to worry about it. Compilers aren't like stereo systems where you have to have the latest and greatest every …

Member Avatar for John A
0
224
Member Avatar for Duki
Member Avatar for guy40az

[QUOTE=iamthwee;337218]Yes you can do the same in c++ so use cout in c++. Period.[/QUOTE] Wanna bet? Ongoing challenge no one has solved yet: [i][color=blue]Convert this printf() statement into [u]readable[/u] C++, output must match exactly:[/color][/i] [code] int iVal = 2; int hVal= 0x0C; char *filename = "test.fil"; char *username = "juser"; …

Member Avatar for ~s.o.s~
0
526
Member Avatar for pooja_singh

[QUOTE=Jamuna;338201]hi pooja this is jamuna i need ur help [/QUOTE] If [B]pooja[/B] is having trouble programming, is [B]pooja[/B] your best source for help? [QUOTE=Jamuna;338201]have u clear those errors in this program?if so post it and i want to clarify one doubt with u.[/QUOTE] Does your instructor want you to use …

Member Avatar for WaltP
1
315
Member Avatar for Lance Wassing
Member Avatar for jan1024188

[QUOTE=jan1024188;337260]Hello, I wanna know if there is any way to make a window transparent using Win32 API Thanks in advance, Jan[/QUOTE] I see lots of possible answers putting the important parts of your question in google...

Member Avatar for jan1024188
0
142
Member Avatar for XxBigxBossxX

[QUOTE=XxBigxBossxX;337917]I'm trying to code the game of Simon(try to mimic the computers choice of four buttons) for a project. I'm kind of stuck because the computer generates a random choice, but I need to completely halt and wait for the user to enter his choice.(Done with the aswd keys; either …

Member Avatar for John A
0
77
Member Avatar for jerryseinfeld

You know, I just went through this entire thread and saw absolutely no code by [B]Jerry[/B]. How can we help if you won't even try anything suggested, and/or won't post what you've tried?

Member Avatar for Lerner
0
192
Member Avatar for maverick786
Member Avatar for fmlyman

Accept the name using 3 inputs for first, middle, last. Store the answers in 3 strings. If you enter nothing, the string is empty.

Member Avatar for John A
0
127
Member Avatar for tousifpk

Are we talking about doing something that back in 1995 the computer industry left behind? Are you running DOS or a command line from XP? And is this homework from a school teaching obsolete practices or from your Dad's (or Granddad's?) old textbook?

Member Avatar for WaltP
0
83
Member Avatar for zaacze

See: [url=http://www.gidnetwork.com/b-38.html]this[/url], [url=http://www.gidnetwork.com/b-57.html]this[/url], and [url=http://www.gidnetwork.com/b-56.html]this[/url] And nothing is urgent on this board... ;)

Member Avatar for WaltP
0
113
Member Avatar for FlyingRedneck

[QUOTE=Infarction;337070]Try just using <iomanip>. I'm guessing that you have VC6.0 or something at school, which uses old (deprecated) headers. [/QUOTE] It uses the new headers, too.

Member Avatar for John A
0
103
Member Avatar for Riazansar

Please [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so we can read it easier. It's something you need to do if this programming game is important to you.

Member Avatar for John A
0
127
Member Avatar for confused!

I'm sure he's been waiting around for 4 months just hoping you'll give him a solution. :rolleyes:

Member Avatar for WaltP
0
288
Member Avatar for guy40az

I assume you don't care about "the compiler under the hood" but how the compiler is used/interfaced. I personally prefer [url=http://www.borland.com/downloads/download_cbuilder.html]Borland 5.5[/url]. Grew up on the command line so I get to use my editor of choice ([url=http://vedit.com]VEdit[/url]) rather than learn the editor they choose for me.

Member Avatar for WaltP
0
140
Member Avatar for RaCheer

[B]RaCheer[/B]. please consider [url=http://www.gidnetwork.com/b-38.html]formatting[/url] your code better. You really need to indent so the code can be followed.

Member Avatar for RaCheer
0
155
Member Avatar for afr02hrs

[QUOTE=afr02hrs;332233]The corrections print out each word of the sentence entered on a seperate line. One word per line. I am trying to get the program to remove multiple spaces entered between words but print out the new sentence with only 1 space per word (all on the same line). I …

Member Avatar for Lerner
0
347
Member Avatar for ramesh.E

[QUOTE=davidcairns;336029]Since your code looks correct the only thing I can think is that the OS you are on is forcing the 8.3 filename convention. [/QUOTE] Not likely since VB only works on $M Operating systems which don't have 8.3 limitations.

Member Avatar for WaltP
0
668
Member Avatar for squinx22

Look at the first character If it's a digit, call a function that converts the next values up to the comma into a number. Return the next location (pointer or index) in the string just after the comma If it's a ", call a function that moves everything up to …

Member Avatar for thekashyap
0
155
Member Avatar for arunk8186

2 things, please #1) [url=http://www.gidnetwork.com/b-38.html]Format your code[/url]. We'd like to be able to read it and help you. #2) [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_clean]English, please[/url]. This is a professional programming board, not a chat room.

Member Avatar for arunk8186
0
134
Member Avatar for robotnixon

[QUOTE=robotnixon;335811]Thanks a lot. It's reading the file just fine now but I noticed another problem after running through a couple generations. I neglected to include a command to populate a cell with three neighbors. No kids means everyone just slowly dies out. Here's the relevant code (let me know if …

Member Avatar for robotnixon
0
196
Member Avatar for bigben09

Hasn't anyone mentioned [url=http://www.gidnetwork.com/b-38.html]code formatting[/url] yet? You need to indent your code so we can follow it. And your titles need work -- [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]see this[/url]. Any more lame titles also warrants an infraction.

Member Avatar for WaltP
0
130
Member Avatar for bigben09

[QUOTE=bigben09;335393]where does the sprintf() go i have never used that or seen that before I am new and just learning the ropes.[/QUOTE] Since you're using C++, might as well stick with [INLINECODE]setw[/INLINECODE] And hasn't anyone mentioned [url=http://www.gidnetwork.com/b-38.html]code formatting[/url] yet? You need to indent your code so we can follow it.

Member Avatar for WaltP
0
110
Member Avatar for satish.paluvai
Re: hi

Oh, Salem, you're so funny :D All [I]compiled[/I] languages are converted into machine language by the compiler. Then finally into executable code that the operating system executes. Also, please [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]read this[/url]

Member Avatar for ~s.o.s~
0
163
Member Avatar for swordy06

[QUOTE=joeprogrammer;334332]>my problem is, that i have been trying to use a counter to display the average and im stumped The problem is that you need to store the data in some sort of array -- preferably a vector, and then you can calculate the average.[/QUOTE] Why? Go simple. In this …

Member Avatar for John A
0
252
Member Avatar for jobra

[QUOTE=Lerner;335146]But then again, maybe I am blowing smoke in the wind.[/QUOTE] Yeah, it's somewhat smoky in here... :D [QUOTE=Ancient Dragon;335090]what compiler are you using? I tried to compile it with three diffeent compilers and none of them knew about strptime().[/QUOTE] It seems to be the reverse of [INLINECODE]strftime()[/INLINECODE] in [url=http://linux.about.com/library/cmd/blcmdl3_strptime.htm]*nix[/url] …

Member Avatar for WaltP
0
120

The End.