255 Posted Topics

Member Avatar for c_Newbie

You're right, that's different from: [CODE=C]char sudoku[] = { '0', '0', '1', '0', '0', '0', '0', '0', '9', '6', '0', '8', '7', '9', '4', '0', '2', '0', '0', '0', '9', '1', '0', '5', '0', '0', '0', '0', '0', '0', '6', '7', '0', '0', '0', '2', '0', '8', '0', '0', '0', …

Member Avatar for c_Newbie
0
112
Member Avatar for serdas

[CODE=PHP]// Get file name from URL and remove any bad filename chars. $url_parts = explode('/', $url); $num = count($url_parts)-1; $file_name = $url_parts[$num]; $badchararray = array(" ", "'", "\"", "$", "&", "%", "-", "#", "^", "*", "(", ")", "~", "@", "/", "?", "="); $file_name = str_replace($badchararray, "", $file_name); $file_name = stripslashes(strtolower($file_name)); …

Member Avatar for death_oclock
0
133
Member Avatar for kishendra

[URL="http://www.daniweb.com/forums/announcement118-2.html"]http://www.daniweb.com/forums/announcement118-2.html[/URL] If people would READ once in a while, we would all be spared a whole lot of trouble.

Member Avatar for me_ansh
0
158
Member Avatar for rciprogrammer

[CODE=C] struct termios chk_options; tcgetattr(fd, &chk_options); if(chk_options.c_cflag & CS8) printf("Eight bit mode\n"); [/CODE] A list of the other flags are [URL="http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap11.html#tag_11"]here[/URL] (11.2.4 Control Modes)

Member Avatar for death_oclock
0
121
Member Avatar for death_oclock

I am making some software to analyze digital sound data. My first step is to find where all the attacks are, or where the starts of notes are. I want to find where there is a significant increase in volume, working with both relative and absolute differences. The difficulty with …

Member Avatar for death_oclock
0
106
Member Avatar for ronjustincase

Using system() commands is not a good idea, and windows specific functions are not a great solution either. You can use [URL="http://cplusplus.com/reference/clibrary/ctime/clock.html"]Clock()[/URL] instead of sleep. Also, check out these [URL="http://www.iu.hio.no/~mark/CTutorial/CTutorial.html#Special%20Control%20Characters%20again"]special control characters[/URL] as a way of clearing the screen.

Member Avatar for death_oclock
0
159
Member Avatar for gr8 icon

How about [URL="http://msdn.microsoft.com/en-us/library/ms646293(VS.85).aspx"]GetAsyncKeyState[/URL]? (windows specific function)

Member Avatar for death_oclock
-2
144
Member Avatar for kevinchkin

Can anyone else not stand the attitude of some people that the world owes them something and they should complain and make a scene until they get it?

Member Avatar for skatamatic
0
108
Member Avatar for kenji

Another solution (I know, you see this one all the time): don't use scanf or it's partners. If you use low level input functions and do the converting yourself, you have much more control over what you can do.

Member Avatar for death_oclock
0
77
Member Avatar for taichou

I would recommend using a [URL="http://en.wikipedia.org/wiki/Bubble_sort"]bubble sort[/URL] with the [URL="http://cplusplus.com/reference/clibrary/cstring/strcmp.html"]strcmp[/URL] function as a comparison.

Member Avatar for ajay.krish123
0
125
Member Avatar for dev.smith

When printing the form, just put the PHP variable in the "value" attribute of the input field.

Member Avatar for death_oclock
0
74
Member Avatar for Cyberbanana1

Does your teacher explain anything else about making the graph? You can make a table of sorts in a console screen.

Member Avatar for Cyberbanana1
0
93
Member Avatar for al3x748769

Instead of this: [CODE=c] for(b = 1, m = len; m > k; m--) { // 1 2 4 8 16 32 64 128 ... place-values, reversed here b *= 2; } // sum it up sum = sum + n * b;[/CODE] Include <math.h> and replace your the previously …

Member Avatar for Murtan
-1
124
Member Avatar for jmoo5

grep stands for global / regular expression / print. First try a search on a way of performing regular expressions in C. Then find a good tutorial on how those work.

Member Avatar for Salem
0
92
Member Avatar for Phil++

Can you include some variable declarations? Otherwise I can't understand how [CODE=C++]door[door][/CODE] even compiles.

Member Avatar for Phil++
0
92
Member Avatar for abhi_marichi

If you really want to, you could write C libraries that mimic java code, as well as many other languages. It would work best in C++ however, which provides a lot of functionality for class-based designs. Most important here, i would think, is operator overloading.

Member Avatar for death_oclock
0
140
Member Avatar for titosd

I think what you want to do is just return the one or zero rather than a struct. The operation can be passed as a pointer to a char (in the parameters). a, b, and c don't need to be pointers.

Member Avatar for death_oclock
0
169
Member Avatar for death_oclock

I am having some trouble with the layout of my project. I'm using several APIs, including the WinAPI and DevIL. I had hoped to encapsulate each one in a separate header file, so that the main program would never have to know whats going on. The problem is, some functions …

Member Avatar for death_oclock
0
157
Member Avatar for death_oclock

My application creates a window in the main thread, but I want the message loop in a separate thread. Is there any way to catch the messages from that window while an another thread? I tried giving GetMessage that window's handle, it didn't work. I could just create the window …

Member Avatar for death_oclock
0
108
Member Avatar for mrnutty

Check out GMP (Gnu MultiPrecision). It allows you to work with extremely large numbers and has wrappers for c++.

Member Avatar for grumpier
0
117
Member Avatar for saalvi

There's a good reason why you're not supposed to feed the bears. If you give them something for free, they'll expect that all the time and won't figure out how to feed themselves. It would seem that people can be the same way...

Member Avatar for death_oclock
0
130
Member Avatar for sciwizeh

You will likely have to use [URL="http://msdn.microsoft.com/en-us/library/bb219802(VS.85).aspx"]DirectInput[/URL]. It provides a *sort of* simple api for dealing with any kind of input device imaginable. Sort of.

Member Avatar for death_oclock
0
121
Member Avatar for Aamit

If you want to use the $time variable somewhere else in the same page, you would be better off getting the time with PHP and then printing it, rather than using the javascript.

Member Avatar for diafol
0
795
Member Avatar for theimben

Maybe you should take a look at how str_replace is used: [URL="http://us2.php.net/str_replace"]str_replace[/URL]. You have to provide something to replace 'new_ad' with. Plus, the function doesn't store the new value in the place of the source string, it returns it so you need to store that somewhere. Try: [CODE=php]$new_result = str_replace($find_ad, …

Member Avatar for mschroeder
0
176
Member Avatar for ammupon

Where is your application located? On a website? In that case have the users download (or just make it themselves) an internet shortcut to that page. If its an application that runs directly on their computer, create a shortcut to a batch (.bat extension) file with something like this in …

Member Avatar for death_oclock
0
74
Member Avatar for jeffc418

Try exploding with spaces. If you know how many fields there are, (with n being the number of fields) you can say every (nth) field is last name, (nth + 1) field is first name, and so on. This does assume that individual fields cannot contain spaces as part of …

Member Avatar for death_oclock
0
424
Member Avatar for rajeesh_rsn

Would you care to be a little more specific? The width of what column is increasing? And why is this a problem? HTML tables will fit to the largest width by default.

Member Avatar for ashafaaiz
0
101
Member Avatar for SinghR

Thanks for resurrecting an old thread that has absolutely nothing to do with your problem just to ask for someone to do your bloody homework for you. Thanks for wasting people's time.

Member Avatar for death_oclock
0
128
Member Avatar for m24r

[QUOTE=Murtan]note that *(glblclrtab + i) is functionally equivalent to glblclrtab[i] but the second is way easier to read.[/QUOTE] Not entirely true, it is possible that the array was broken up in memory (to save space, or maybe just to piss programmers off). The first approach will not account for that, …

Member Avatar for death_oclock
0
169
Member Avatar for knrakesh

Please use CODE tags. And could you post the relevant code so we don't have to wade through all of that? Try posting just where it is getting or defining the categories/subcategories and where it is adding things to a table (in a database, I assume). But without looking at …

Member Avatar for death_oclock
0
206
Member Avatar for RenFromPenn

Umm, that sounded pretty unnecessary. Try: [CODE=c]printf("row %d sum = %d\n", r + 1, tot);[/CODE] Keep the loops the same. It will start the labeling at 1 (0 + 1) and go to 3 (2 + 1).

Member Avatar for devnar
0
182
Member Avatar for vsla

Submit takes me to payment.php, which doesn't exist. What file is the code you provided supposed to be for? At any rate, this is not a PHP issue.

Member Avatar for death_oclock
0
112
Member Avatar for 0weavern

That massive amount of code is a huge turnoff for potential help. Can you post the relevant parts? And it would help if you could be more specific with your problem. (Not more wordy, as some people seem to think)

Member Avatar for death_oclock
0
167
Member Avatar for lehe

printf("\r"); It may be compiler-specific, it may be platform dependent, so use discretion but give it a try.

Member Avatar for ajay.krish123
0
123
Member Avatar for Naveen_bij

You can't put a button into a console. The only way to parse mouse event in one is using a bizarre Windows-specific process. You would need to use the Windows API for something like that, and it's way too much for a beginner. Try visual basic.

Member Avatar for death_oclock
0
94
Member Avatar for ajay.krish123

Agreed. Just a wild guess, if you're using Windows, check out DirectSound (msdn, google search will serve you well). But this of course would come [U]after[/U] substantial knowledge and experience with the language.

Member Avatar for Salem
0
114
Member Avatar for robgeek

You are passing in to set_add variable that don't exist yet! In the beginning of your main, declare them like this: [CODE=c++] string St_address; string city, state; int Zip; [/CODE] Although your code was sort of hard to understand, the prototype for set_add said it was a mutator. But the …

Member Avatar for daviddoria
0
111
Member Avatar for death_oclock

I have the following globals defined (the relevant ones, anyway): [CODE=c] DWORD dwNumMaterials; LPD3DXBUFFER lpMaterials; LPD3DXMESH lpMeshBody; [/CODE] And the call to D3DLoadMeshFromX is here: [CODE=c] D3DXLoadMeshFromX(L"body.x", D3DXMESH_SYSTEMMEM, lpD3DDevice, NULL, &lpMaterials, NULL, &dwNumMaterials, &lpMeshBody); [/CODE] When this is called, it returns a generic error (0x80004005). Also, if it is needed …

Member Avatar for death_oclock
0
125
Member Avatar for Traicey

Several database servers (mySQL, for example) include libraries and headers for C that allow programs to access databases. You should easily be able to find a tutorial on how to do it with your choice of server.

Member Avatar for death_oclock
0
108
Member Avatar for death_oclock

I have the following globals defined (the relevant ones, anyway): [CODE] DWORD dwNumMaterials; LPD3DXBUFFER lpMaterials; LPD3DXMESH lpMeshBody; [/CODE] And the call to D3DLoadMeshFromX is here: [CODE] D3DXLoadMeshFromX(L"body.x", D3DXMESH_SYSTEMMEM, lpD3DDevice, NULL, &lpMaterials, NULL, &dwNumMaterials, &lpMeshBody); [/CODE] When this is called, it returns a generic error (0x80004005). Also, if it is needed …

Member Avatar for death_oclock
0
129
Member Avatar for death_oclock

I am making a blitting call on my backbuffer: [CODE=C++] BOOL drawImage(IMAGE *lpImage, LONG x, LONG y) { RECT rect; rect.left = x; rect.top = y; rect.right = x + lpImage->lWidth; rect.bottom = y + lpImage->lHeight; dwVideoErrCode = lpBack->Blt(&rect, lpImage->lpSurface, NULL, DDBLT_WAIT | DDBLT_KEYSRC, NULL); if(dwVideoErrCode != DD_OK) { MessageBox(NULL, …

0
71
Member Avatar for death_oclock

I am using DirectDraw to make a game and I am running it in 8-bit color mode. What I am having a problem with is making a macro to convert RGB values into a single 8-bit color. Here is the macro: [CODE=c++] #define RGB_8BIT(r, g, b) ((r & 224) + …

Member Avatar for chaosprime
0
159
Member Avatar for Gusts

Here's the important segment of the array duplicates problem: [CODE=c++] for(int i = 0; i < 1000; i++) { for(int j = 0; j < 1000; j++) { if(i != j) { if(arr[i] == arr[j]) { return arr[i]; } } } } [/CODE] This just checks every element of the …

Member Avatar for Alex Edwards
0
307
Member Avatar for death_oclock

I need to find the number of elements in an array passed into a function. The problem is in this case, sizeof() returns the size of the pointer itself. It only does this when passed through to a function. So here is that function: [CODE=c++] bool matchWord(TWORD *wordList, TWORD *word, …

Member Avatar for death_oclock
0
192
Member Avatar for michinobu_zoned

I'm a referring to the original post here: On this line: [CODE]pair[k]=atoi(&argv[i]);[/CODE] You are actually passing in a pointer to a pointer while the function only takes a pointer. Remove the '&', this is whats causing a problem.

Member Avatar for dwks
0
2K
Member Avatar for singal.mayank

I would make an array of strings, one element for each line. Than use something like getchar() to read in one character at a time until you find a '\n' (newline) character. Then start using the next element and read in the next line likewise until you reach the end …

Member Avatar for singal.mayank
0
164
Member Avatar for nelledawg

Lets please not have everyone get so offended here. Some of you people really need to chill out. In response to the code: When [U]calling[/U] a function, you don't include data types. You simply pass in the variables you want the function to use. Although I would recommend doing some …

Member Avatar for jephthah
1
263
Member Avatar for neknek

Maybe you should have read some of the forum rules: we aren't going to "give you" the code. Then you aren't learning which kind of defeats the point, right? Jishnu gave you an excellent tutorial to read, I was just about to suggest a bubble sort myself. Once you understand …

Member Avatar for ssharish2005
0
109
Member Avatar for VernonDozier

You could use the WinAPI file functions ([URL="http://msdn2.microsoft.com/en-us/library/aa364232(VS.85).aspx"]http://msdn2.microsoft.com/en-us/library/aa364232(VS.85).aspx[/URL]) which allow you to set sharing permissions (as well as other flags and such for the sort of thing you described).

Member Avatar for VernonDozier
0
214
Member Avatar for rimmytose

This looks like it requires some library files that you didn't add. Go to the project settings, go to Configuration Properties->Linker->Input->Additional Dependencies. Add any .lib files you find with the other twofish files in this field. You may have to add the folder they're in to Configuration Properties->Linker->General->Additional Library Dependencies. …

Member Avatar for mitrmkar
0
108

The End.