15,300 Posted Topics

Member Avatar for Onlineshade

Welcome back. A lot has changed in the past week or so, so you might want to briefly look at some of the threads in DaniWeb Commnity Forum.

Member Avatar for Ancient Dragon
0
52
Member Avatar for FelineHazard

>Why does including (float) make the difference? Because 1/2 is integer digision, and 1 divided by 2 is 0. Make it float in a couple ways: 1) 1.0F/2.0F or 2) (float)1/2, or 3) 1.0F/2, or 4) 1/2.0F. Any of those methods are ok, just a matter of personal preference.

Member Avatar for FelineHazard
0
195
Member Avatar for cryonize

Your program worked perfectly for me using VC++ 2010 Express on Windows 7. since this is c++ code you don't need the typedef symbol.

Member Avatar for mike_2000_17
0
10K
Member Avatar for zingwing

the easiest way to do it is to just copy everything from InputArray to OutputArray, then sort OutputArray. If you are allowed to use it you can copy the entire array with one line of code using memcpy() function. If you can't use that function then do the copy in …

Member Avatar for Ancient Dragon
0
199
Member Avatar for MrEARTHSHAcKER

Dump that old ancient compiler and buggy IDE. Get either free VC++ 2010 Express or free Code::Blocks w/MinGW compiler. Both compilers will produce startup DLL projects for you. [Here is a tutorial](http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855/DLL-Tutorial-For-Beginners.htm)

Member Avatar for Ancient Dragon
0
170
Member Avatar for MicrosoftMahmou

>m1[10][10] = rand() % 10; that is doing nothing but populating a single cell, which is NOT in the matrix, with a single random number. There is no such cell in that matrix. >if(r2==c1) Huh? What difference does it make if r2 is the same value as c1? r2 is …

Member Avatar for zeroliken
0
236
Member Avatar for km2011

Not sure what you are trying to accomplish with that code, but the reason that you don't see all the data is probably due to those two if conditions. Remove them and just set each element to some random number. ~~~ for(i = 0; i < sizes; i++) { for(j …

Member Avatar for km2011
0
180
Member Avatar for TheOnlyRoss

use fgets() instead of scanf() so that all the words get put into the string. ~~~ int main() { char line[100]; fgets(line, sizeof(line), stdin); } ~~~

Member Avatar for zeroliken
0
203
Member Avatar for terrah

The first thing I noticed is that this->name is an unallocated pointer (line 67, road.cpp). You have to allocate memory for it before you can call strcpy() in the second constructor. line 7, main.cpp: missing the third parameter to the constructor.

Member Avatar for Ancient Dragon
0
145
Member Avatar for cryonize

The easiest way to do the swap is to swap the data, not the node itself. If you do that then there is no problem with pointers because they won't be changed. When a node has a lot of data items it is easier to put them into a structure …

Member Avatar for TrustyTony
0
9K
Member Avatar for varunme

In a loop, convert each byte to binary then add to an int accumulator, for example assume you have a character array named "msg" and a loop counter named "i" sum = (sum * 10) + msg[i] - '0';

Member Avatar for Fiverivers
0
238
Member Avatar for hwoarang69

You need to tell us about the problems you are having. Would you take your car to a repair shop and tell the people "my car is broke, please fix it". Of course not, you have to explain as best you can what's wrong with your car. Same here. We …

Member Avatar for Ancient Dragon
0
117
Member Avatar for ilearnz001

You can easily check that if you just print out the contents of Packet_Request

Member Avatar for Ancient Dragon
0
123
Member Avatar for n.cramp

> GLubyte indices[]; Declare that as a pointer and allocate memory for it on line 35, after you know how big it should be. >void createGeo(geo inst) Pass that object by reference, not by value. such as void createGeo(geo& inst)so that any changes made by createGeo() are reflected in the …

Member Avatar for n.cramp
0
3K
Member Avatar for GillBates

The number 48 is for the character '0' (zero), google for "ascii chart" and you will get a complete list. In the code you posted the -48 is converting a charcter digit '0' to '9' to binary, by subtracting '0' from it.

Member Avatar for Ancient Dragon
0
72
Member Avatar for wzseow

exactly like you would any array of objects, such as an array of its. Note that the first two parameters of the format string need to be %s, not %c because %c only allows entry of a single character while %s allows entry of an entire word. You should also …

Member Avatar for zeroliken
0
20K
Member Avatar for Dani

When I create a new thread will I have a list of check boxes that I can select which forum(s) apply? That sounds like it could get very confusion real quick. What if someone just checks them all?? If I respond to a thread in one of the forums is …

Member Avatar for diafol
0
279
Member Avatar for Ancient Dragon

I tried using [code] and [/code] but that doesn't work. I tried using the Code button but that didn't seem to work either (i.e. past code into editor, highlight, then hit the Code button). So how to add code tags?

Member Avatar for Dani
0
320
Member Avatar for idiotguy

> I cant find any libcurl tutorial on the web. Huh? That's odd because I found lots of them [here](http://lmgtfy.com/?q=libcurl+tutorial)

Member Avatar for Ancient Dragon
0
155
Member Avatar for Dani
Member Avatar for kase20

>This is what I have but it isn't working in the slightest..?? That program worked ok for me using VC++ 2010 Express on Windows 7. If its broken for you then I suspect that pheininger is correct in his assessment. Change int sixdigits to long sixdigits

Member Avatar for Ancient Dragon
0
107
Member Avatar for phorce

Code tags [code] [/code] don't work anymore. See the discussion in [this tread](http://www.daniweb.com/community-center/daniweb-community-feedback/threads/418759/code-tags)

Member Avatar for phorce
0
118
Member Avatar for Ancient Dragon

How can I get there without going through another post that's already in Area 51? I don't see a link anywhere for it.

Member Avatar for Dani
0
62
Member Avatar for hwoarang69

If you want to put it into the first byte of ar[] then what you posted is ok. If you want to put it somewhere else then you have to tell the compiler where to put it, e.g. fread( &ar[i], 1, 1, fine);

Member Avatar for Ancient Dragon
0
115
Member Avatar for luislupe

My guess is that readST() is trashing memory, and when that happens it can affect anything or everything ion the program. There is nothing in the code you posted that should cause the problem because all it does is open and close the files.

Member Avatar for Ancient Dragon
0
2K
Member Avatar for tubby123

If you want to convert "10" to 10 then you need to call one of the conversion functions, such as atoi() ~~~ printf("%d\n", atoi("10")); ~~~

Member Avatar for Ancient Dragon
0
75
Member Avatar for Ancient Dragon

Do you get paid whenever I click one of the ads ? The reason I'm asking is because I want to decide whether to turn them off or not. Some of the ads seem to be worthwhile reading so if it will bring you more revenue then I might just …

Member Avatar for Dani
0
107
Member Avatar for NormR1

>Dani was kind enough to give the rest of us that ability. Any verified member can undo reputation. Yes I can confirm that works for non-staff members because I tried it to test something else earlier today.

Member Avatar for Ancient Dragon
0
186
Member Avatar for Hilfiger

>Unfortunatly i do not know C C is not really a prerequisit for learning c++ unless your instructor and school says it is. The requirements you posted for the program are pretty vague. Is that all the info you were given?

Member Avatar for Lerner
0
115
Member Avatar for tischn

The problem could be line 15: many older compilers don't like declaring variabes anywhere except at the beginning of a block enclosed in { and }. That's ok with c++, but not C.

Member Avatar for tischn
0
1K
Member Avatar for khfreek

You can't use cin >> name and expect to get a string with spaces. call getline() instead so that it will capture spaces within the string

Member Avatar for Ancient Dragon
0
92
Member Avatar for Ben464

>Can someone please answer this for me as i cant do this practice question No, we do not do homework for people. Give it a try then post what you have attempted.

Member Avatar for Ancient Dragon
0
45
Member Avatar for Ancient Dragon

See my last two or three posts here: http://www.daniweb.com/software-development/c/threads/418582/system-function-problem When I enter "d.mkv" the editor removes everything but d.mkv. Not good when posting code.

Member Avatar for Dani
0
150
Member Avatar for Kashaku

line 10: > )malloc(sizeof(argv) Wrong. sizeof(argv) is always 4 because its a pointer.

Member Avatar for Kashaku
0
158
Member Avatar for Ancient Dragon

I a getting a bunch of db errors. Below are just a few of them > Deprecated: Assigning the return value of new by reference is deprecated in /home/daniweb/pfo_httpdocs/includes/init.php on line 49 Deprecated: Assigning the return value of new by reference is deprecated in /home/daniweb/pfo_httpdocs/includes/init.php on line 97 Deprecated: Assigning …

Member Avatar for pritaeas
0
103
Member Avatar for DJXiej

> why a character array isn't being recognized as a pointer already. The reason is that you have hidden the global char array named "input" with the local parameter with the same name. In such cases the compiler ignores the global variable. To correct the problem delete the global array …

Member Avatar for histrungalot
0
453
Member Avatar for CelestialTeapot

You have to format the string with sprintf() before passing it to system() or rename() functions -- those functions don't work like printf().

Member Avatar for CelestialTeapot
0
156
Member Avatar for bubbleT

The conversion will fail on languages that require more than one byte to represent a character such as many Chinese and Japanese glyphs

Member Avatar for BobS0327
0
179
Member Avatar for Ancient Dragon

[URL="http://www.youtube.com/watch?v=L6dzUOYTQtQ&feature=ymg"]Here [/URL]is a YouTube video about how we celebrate this holiday :)

Member Avatar for bumsfeld
0
29
Member Avatar for skiabox
Member Avatar for Dani
0
352
Member Avatar for Ancient Dragon

Will you please add a button to quickly copy code inside code tags to clipboard? I find it really annoying and inconvenient to use the mouse to highlight all the code inside code tags, it was a lot easier in the vBulletin version.

Member Avatar for deceptikon
0
171
Member Avatar for hwoarang69

>>while(fread(ar, 1, 20, file) != NULL) That only reads 20 bytes of data instead of 20 * sizeof(int) number of bytes. You need this? while(fread(ar, 20, sizeof(int), file) != NULL) >>how read one line at a time, You mean how to read one integer at a time? int i = …

Member Avatar for Ancient Dragon
0
132
Member Avatar for Dani
Member Avatar for Dani
0
158
Member Avatar for Ancient Dragon

Is PFO coming back anytime soon? It's been swamped with spam the past few days, but I hope you will bring it back soon.

Member Avatar for blud
0
22
Member Avatar for mc3330418

>>how do i pass these to the functions in the driver file? The file that contains main() is considered the "driver file". In your first code snippet all you have to do is include the header file that you created, like this [code] #include <iostream> #include "myheader.h" // <<<<<<<<<<<<<<<<<<<<< here …

Member Avatar for Ancient Dragon
0
208
Member Avatar for ilovephil

Depends on the operating system. [URL="http://bytes.com/topic/c/answers/440423-how-recognize-function-keys-c"]Here [/URL]is one thread you might want to read.

Member Avatar for jbennet
0
177
Member Avatar for joseph_butler

program statements have to be written in logical sequence. For example you can not add LetterGrade to Sum before you know the value of LetterGrade. And LetterGrade has to be converted from A to F into numeric value befor it can be added to Sum. [code] char LetterGrade = 'A'; …

Member Avatar for absar.mazhar
0
4K
Member Avatar for arbazpathan
Member Avatar for tubby123

[icode]char* str[][/icode] is the same thing as [icode]char** str;[/icode], which is a two dimensional array where both dimensions are unspecified and must be allocated at runtime. [icode]char* str[5];[/icode] is also a two dimensional array, but in this case you have hard-coded one of the dimensions to be of length 5. …

Member Avatar for Adak
0
1K
Member Avatar for CriticalError

I think I read that the only difference is in the libraries to support the next generation of Windows.

Member Avatar for CriticalError
0
203

The End.