299 Posted Topics

Member Avatar for tanvirraj91

[I]Token plug for ported GNU compilers.[/I] Get the MinGW/MSYS if you're using Windows, but want to run on the command line. [url]http://sourceforge.net/projects/mingw/files/[/url] Grab the link near the upper middle that says "Looking for the latest version?" Get DJGPP if you are actually using honest to goodness DOS 5.0 - 6.22 …

Member Avatar for DeanMSands3
0
168
Member Avatar for rfrapp

There are two loops in the bubble sort. With one loop, essentially, you're only doing one pass, sorting the highest value to the top, but neglecting the others. This may prove useful: [url]http://www.codecodex.com/wiki/Bubble_sort[/url] Also, you may want to change that i==5 to i==4. When i equals 5, you'll be starting …

Member Avatar for DeanMSands3
0
177
Member Avatar for shanki himanshu

I was going to roll my own, but this works just fine. [url]http://www.fredosaurus.com/notes-cpp/algorithms/string2int-ans.html[/url] Adapt it to eliminate the [B]bool[/B]s if you need to, but the code should work just fine.

Member Avatar for DeanMSands3
0
150
Member Avatar for skorm909
Member Avatar for DeanMSands3
0
99
Member Avatar for psdtohtmlinfo

Well, you can do a private Wi-Fi network secured with Pringles cans (you think I'm joking). Or you can set up laser transceivers - effectively fiber-optics without the cable. Unfortunately, ANYTHING can upset the signal. Anything. Like squirrels. Rain. Kites. Obese persons on ladders. Anything.

Member Avatar for DeanMSands3
0
146
Member Avatar for Tiffany216

Program 1: [LIST=1] [*]Prompt the user for the file size in KB of the first file. [*]Scan for keyboard input and store in a variable. [*]Multiply by that by the number of bytes in a KB. Multiply again by number of bits in a byte. [*]Prompt the user for the …

Member Avatar for DeanMSands3
0
124
Member Avatar for chuyauchi

Two possibilities. A. roll=int(num*11)+2; //Just reduce the 12 to 11 and add 2 instead of 1. B. rewrite it to roll a single die, save the value, then roll again.

Member Avatar for DeanMSands3
0
153
Member Avatar for JilMakias

What you want to do is likely above your present ability. (For now.) I'm telling you this kindly. However, you have asked a question, and I will answer it. (Who knows, this might be the start of a wonderful new world of socket programming for you.) First, since you are …

Member Avatar for DeanMSands3
0
6K
Member Avatar for vic s

OK, look at your main function: [CODE]int main(){ int option =0; bool exit = false; while(!exit) { displayMenu(option); switch(option) { case 1: doTaskA(); continue; case 2: doTaskB(); continue; case 3: doTaskC(); continue; case 4: howMany(); exit = true; break; default: printf("Incorrect selection. Try again.\n"); continue; } } return 0; } …

Member Avatar for DeanMSands3
0
233
Member Avatar for drewangel

I want to make a hoe joke so very badly... So... nobody brought this up, but [B]libPThread[/B] is PRIMARILY a [B]Linux[/B] library being "[B]POSIX Threads[/B]." There is a Windows implementation available and can be installed as part of [B]MinGW[/B] using it's Get command (i.e. [B]mingw-get[/B], the command line apt-get substitute). …

Member Avatar for DeanMSands3
0
732
Member Avatar for jaskij

Very nice. However, somewhere along the line, in the zoom functions, times became an asterisk and center became a cent.

Member Avatar for jaskij
1
182
Member Avatar for Karlwakim

Let's start with the basic psuedo code: [CODE]X=2 WHILE X IS LESS THAN MY_NUMBER IF MY_NUMBER MODULO X IS 0 THEN RETURN FALSE ELSE INCREMENT X BY 1 LOOP RETURN TRUE[/CODE] Now, that's fantastic and all, but it's very inefficient. After 2, there aren't anymore even primes. Let's make our …

Member Avatar for jaskij
0
253
Member Avatar for angah

Hm... just for sanity's sake, make this change: [CODE] org 0x000 goto Start org 0x005 Table_ addwf PCL,f dt 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f [/CODE] I've got a little background in PICs. I'll look over this more when I get the chance.

Member Avatar for angah
0
246
Member Avatar for shaunchu

[B]string[/B] is a C++ type. You'll want to convert your code to use C++ instead. [B]string.h[/B] is a C header file and doesn't provide that. If you don't want to use C++, you should use character arrays. And instead of acountry[j]=arr[i]; you would use [B]strcpy(&acountry[j].code,&arr[i]);[/B]

Member Avatar for shaunchu
0
176
Member Avatar for wasiqjaved

Well, to start, setup a space for your string for 11 bytes(trailing zero) and put that in your data section. Also, put your string prompts into the .data section. (i.e. "Enter 10 character string: ") Then, in your main program, you print the prompting string (you know how to use …

Member Avatar for DeanMSands3
0
554
Member Avatar for Fixxxer

[COLOR="Red"]Without generating the data myself I'm kind of limited in what I can do to help. However, [B]chi_squ_end[10000000][/B] bugs me. A lot. And being a double type, on a 32-bit system, that thing's 80 Million bytes huge. May I humbly suggest moving outside and before the main block. This takes …

Member Avatar for VernonDozier
0
125
Member Avatar for messr135

Well, for starters, you want to put your code inside the [B][ CODE ][/B] blocks. It preserves the formatting. Looking at your code isn't as much fun without indentation. And... and... you have used GOTO. [B][COLOR="Red"]And you have sinned.[/COLOR][/B] Just kidding. (But you may want to look into ways around …

Member Avatar for DeanMSands3
0
108
Member Avatar for arold10

WaltP and Deceptikon are right. And I can tell they're ready to lose their patience. It's a simple fix, but to a new coder, it may not be obvious. See this line of code? [CODE] printf( "Enter gallon used (-1 to end): " ); scanf( "%d", &gallon); [/CODE] This is …

Member Avatar for zeroliken
0
155
Member Avatar for C++ programmer

Multi-threaded/process programs for starters. Mutexes, Semaphores, all the yummy goodness. Then there's windows, messages, callbacks. You know. The stuff they don't teach you in college until MAYBE the senior year. Even then, my Operating Systems class never touched GUIs let alone straight from the OS API. This is the good …

Member Avatar for Ancient Dragon
0
142
Member Avatar for Shardendu

File->New Project->Static Library. It will create an [B].a[/B] file. Reference that project in your linker libraries in your next project.

Member Avatar for Shardendu
0
152
Member Avatar for lxXTaCoXxl

These is not the article you are looking for. (Especially Method 3.) [url]http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c5451[/url]

Member Avatar for DeanMSands3
0
533
Member Avatar for guccimane

That's some-funny looking code in the first program. It looks like one programmer wrote a "test port" program and a second one expanded it into a http client. In the header, it looks like we're using an http client with a single parameter. [CODE]/*** "GET <resource> HTTP/1.0\n\n" (the second newline …

Member Avatar for DeanMSands3
0
141
Member Avatar for shuchi0113

Well, this goes back to 16-bit addressing (as revealed by your use of [B]near[/B]). In 16 bits, the size of an int (being 16 bits) is 2 bytes. You increment it twice. But the compiler knows it's an int pointer, so it increments it by 2 each time. So you're …

Member Avatar for shuchi0113
0
586
Member Avatar for mk.hashmie

Use the [B]|CODE|[/B] blocks to keep your code lined up straight. This is the code with indentation, spelling corrections, and consistency edits. The code is functionally the same. [CODE]#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> int main(){ FILE *A, *B; char another; int choice; struct student{ char name[40],f_name[40]; int age,clas; long int rnum, …

Member Avatar for DeanMSands3
0
154
Member Avatar for stakeMyHeart

I'm not seeing why you want to use A*. Have a look at these instead. [url]http://en.wikipedia.org/wiki/Flood_fill[/url] [url]http://tog.acm.org/resources/GraphicsGems/gems/SeedFill.c[/url]

Member Avatar for stakeMyHeart
0
479
Member Avatar for sodha125

@Lerner: ditto. @Ancient Dragon: Also ditto. Cangan's code is a starting point. Nothing more. And that's what was asked for. I'd replace the [B]if[/B] statement with a [B]switch/case[/B] block that catches vowels. Lastly, the instructor says to use cin, but to break on the return. Cin accepts until return, but …

Member Avatar for KasmIR
0
202
Member Avatar for babydeluxe

You have a carry you're not taking care of after you parse everything. Try putting in leading zeros and see what happens (it should work). However, that's not how you want to do it. You'd need to insert the carry bit in the front and push the rest of the …

Member Avatar for WaltP
0
1K
Member Avatar for ram619

Well, look at what's happening to your pointer and it'll let you know. I modified your code to do this. [CODE] #include<stdio.h> #include<conio.h> void main() { int arr[3]={2,3,4}; char *p; //clrscr(); p=arr; printf("*p:%d, p: %ld\n",*p, p); p=(char*)((int*)(p)); printf("*p:%d, p: %ld\n",*p, p); p=(int*)(p+1); printf("*p:%d, p: %ld\n",*p, p); //getch(); }[/CODE] It gave …

Member Avatar for ram619
0
113
Member Avatar for belber

Hi, Yordan! Welcome to Daniweb! Hope you can get your bar code scanner done. Myself, I steer clear of VB, but to each his own. Happy coding!

Member Avatar for Consyarek24
0
50
Member Avatar for marypablate

Oh hey! You got bots here too? I thought I left those behind in Webmaster Talk Forums.

Member Avatar for DeanMSands3
0
59
Member Avatar for dedmon

Welcome to DaniWeb. The only stupid question is a question un-asked. Or about Visual Basic. Happy Coding!

Member Avatar for DeanMSands3
0
34
Member Avatar for rohan121212

Be patient. It's still processing. It doesn't print until all the random numbers have been generated. Those sometimes take a while. Especially when there are a lot of them. Compiled code with G++. Ran with CPU under moderate load. Finished in 14 seconds. I'm not seeing any problems.

Member Avatar for LRRR
0
142
Member Avatar for LucyButterfly22

OK, so it sounds like you want to put a dot on the screen and get your test subject to look at it even though their eyes are wired not to. Is that the gist of it? If you're going to use C++ and you're pretty new to it, well... …

Member Avatar for DeanMSands3
0
109
Member Avatar for sharathg.satya

This maybe useful to help you understand: [url]http://en.wikipedia.org/wiki/MSDOS#Legacy_compatibility[/url] [url]http://en.wikipedia.org/wiki/Microsoft_Windows#History[/url] [url]http://en.wikipedia.org/wiki/16-bit_application[/url] [url]http://en.wikipedia.org/wiki/32-bit_application[/url] [url]http://en.wikipedia.org/wiki/64-bit_application[/url] As you can see, Windows follows two family trees. The upper left tree is based on MSDOS, which is a 16-bit operating system. It required special software to allow programs to run in 32 Protected Mode. Windows 95, …

Member Avatar for DeanMSands3
0
178
Member Avatar for swissknife007

This sounds suspiciously like the problem Gourav1 posted last week. I provided an answer that should satisfy. See his post here: [url]http://www.daniweb.com/software-development/c/threads/407089/1737797#post1737797[/url] See my response here: [url]http://www.daniweb.com/software-development/c/threads/407089/1738493#post1738493[/url] Gourav1's question was directed at text animation. However, a graphical solution could easily be adapted. When drawing your image, draw by columns, and …

Member Avatar for DeanMSands3
0
843
Member Avatar for domatessuyu

[CODE] char numberAsString[6]; char numbers[][]= {"Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"}; do{ printf("Enter a number (0-9): "); scanf("%d",&number); }while(number<0||number>9); strcpy(numberAsString, numbers[number]); printf("You entered %s.\n", numberAsString); [/CODE]

Member Avatar for domatessuyu
0
168
Member Avatar for gourav1

Gourav1, you are now my new favorite poster. You give us problems from 15 years ago. To check and debug your code, we'd need DOSBox and an ancient (and completely legitimately obtained) copy of Turbo C++ 4.5. Epic win. [url]http://www.go4expert.com/forums/showthread.php?t=21153[/url] Have a look at this page. Run all the examples. …

Member Avatar for DeanMSands3
0
181
Member Avatar for vedro-compota

Threads can return values. Which API are you using? Here's an example for PThreads: [url]https://computing.llnl.gov/tutorials/pthreads/#Joining[/url] Since the thread function is a void pointer, it can point to any piece of data you like, and is retrievable with the pthread_join function. For Windows, you can use the GetExitCodeThread function. [url]http://msdn.microsoft.com/en-us/library/windows/desktop/ms683190(v=vs.85).aspx[/url]

Member Avatar for vedro-compota
0
221
Member Avatar for shantanusinghal

Used shared memory. This will help you get started. [url]http://www.cs.cf.ac.uk/Dave/C/node27.html[/url] [url]http://digiassn.blogspot.com/2006/07/cc-unix-ipc-shared-memory-example.html[/url]

Member Avatar for DeanMSands3
0
301
Member Avatar for DarkMonarch

How many copies of MinGW do you have on your system? If you're using Dev C++, then that makes at least one. Reference: [url]http://cboard.cprogramming.com/cplusplus-programming/111216-compiler-problem.html[/url] Make sure to use a recent copy of MinGW and update often. I would also include a bare-minimum MSYS including Make.

Member Avatar for DarkMonarch
0
266
Member Avatar for DeanMSands3

In my wayward youth, I learned a little bit of inline assembler in Turbo C. And that was fun. Then I got into DJGPP which came with GCC and Bell Syntax. And it was confusing. And I gave up. Fast forward 12 years. I'm 30, finishing a bachelor's in CS. …

Member Avatar for DeanMSands3
0
223
Member Avatar for gourav1

Let's start with the basics. You're going to print out a set of characters in an array on a screen. You're going to jiggle the characters by a wavy function, let's say the sine function. You're going to output in color. Each character in the array has a color assigned …

Member Avatar for DeanMSands3
0
1K
Member Avatar for YAMNA MIDHAT

@WaltP: Those are very good points, and I agree. @Yamna Midhat: OK, some things I see after some minor debugging. [B]Line 105[/B]: Missing ampersand. Change that to [CODE]scanf("%d",&cos);[/CODE] [B]Line 336[/B]: Missing ampersand. Change that to [CODE]scanf("%d",&item_no);[/CODE] At delet_selectd(): you're not checking current->next to see if it's allocated yet. This will …

Member Avatar for ChrisPadgham
-2
166
Member Avatar for terence193

[B]try[/B] is a keyword. Also, have you already allocated the memory space for character array pointed to by *[I]filename[/I]? (By allocate, I mean like [B][I]char buffer[20];myFilename=(char*)buffer;try(myFilename);[/I][/B] or [B][I]myFilename=new char[20];try(myFilename);[/I][/B]

Member Avatar for terence193
0
254
Member Avatar for cangan

I haven't gotten into CLR C++ yet, but I'll take my best shot. [CODE] MyDataType_Class ^myFunction(String someName="",int someID=0){ MyDataType_Class ^new Person=gcnew MyDataType_Class(); Person->id=someID * 2; //Multiply by 2 just because Person->name=someName; return Person; } . . . void SomeOtherFunction(){ MyDataType_Class ^thisPerson=myFunction("Runcible Spoon", 21); . . . } [/CODE]

Member Avatar for cangan
0
280
Member Avatar for blackfireburn

I can think of two ways to do this. (Also, get rid of the return j. It returns from the main function and exits the program. Get rid of the printf(j) at the bottom. Why do you have it?) [B]First[/B]: using arrays. Since you're using characters 7 lines tall, create …

Member Avatar for DeanMSands3
0
322
Member Avatar for gfp91

Wait for the screen to refresh. See if your API will let you do that. What API are you using anyway?

Member Avatar for gfp91
0
121
Member Avatar for kotsarikos

So... I thought, how would I do this the RIGHT way in C? No STL at all. Hm... Arrays, well, they're kind of passe'. Linked Lists are the bees knees. Or something. I was thinking about using BSTs, but wasn't sure at what point to implement leveling/balancing. I decided that …

Member Avatar for DeanMSands3
0
105
Member Avatar for lotsofsloths
Member Avatar for ichigo_cool
-1
1K

The End.