15,300 Posted Topics

Member Avatar for general2012

if you want to use strcpy() just do this: ` strcpy(p->name,input_name);` > gets(input_name); Never call gets() because it will allow you to enter more characters then the buffer can hold. All excess characters are just scribbled all over your program's memory. Instead, call fgets() like this: `fgets(input_name, sizeof(input_name), stdin);` <<< …

Member Avatar for general2012
0
188
Member Avatar for silvercats

1. because it's in the std namespace, as are all the other classes in the fstream and iostream header files. 2. dont' know, but Mike probably does 3. Yes, because they are implemented by different compilers. The same iostream is implemnentsed by all c++ compilers, that doesn't mean they are …

Member Avatar for silvercats
0
131
Member Avatar for vinnitro

Sorry, but killing someone is never funny or humorous, except maybe in a cartoon like RoadRunner where the person or other living creature is not really killed.

Member Avatar for <M/>
1
218
Member Avatar for bastrop52

Are you trying to tell us that when the ink carterage runs out of ink we should just buy another printer a couple hundred dollars instead of a new ink carterage for $25.00USD?

Member Avatar for whipaway
0
286
Member Avatar for muhammad.khan.3576
Member Avatar for amrit_anand

we are not going to just hand you the code, but will be glad to help you with your program. What exactly don't you understand? Have you read your textbook about file handling? Have you used google to search for "fstream tutorials"? I suspect not.

Member Avatar for Ancient Dragon
0
147
Member Avatar for new_developer

This is one of the few times C and C++ are different, at least in older versions of C. At one time NULL was defined as (void \*)0 e.g. `#define NULL (void\*)0`, so it was an error to assign NULL to a non-pointer. Turbo C still uses that since its …

Member Avatar for Ancient Dragon
0
614
Member Avatar for <M/>

Are you looking in the right column? I'm #36 in the list today and you are #2.

Member Avatar for <M/>
0
377
Member Avatar for general2012

int main() { college student ={"james", "carter"}; printf("%s %s ", student.name); getch(); }

Member Avatar for general2012
0
142
Member Avatar for nitin1

You can always turn on invisibility mode in your Profile then you won't appear in the activity stream.

Member Avatar for Sahil89
0
377
Member Avatar for jalpesh_007

You shouldn't say "Hollywood" and "morals" in the same sentence :) Hollywood lost all morals years ago when they started producing R rated movies which contain lots of violence, cursing and sex.

Member Avatar for jalpesh_007
0
394
Member Avatar for nitin1

You mean you want to work on your vacation? Take some time off from programming and do something else, like skiing, sky diving, or scuba diving. Or just relax, go to the beach and watch the girls go by.

Member Avatar for nitin1
0
526
Member Avatar for phorce

>I would be in favor of a feature similar to "flag bad post" but for an edit request, for small edits like fixing formatting. You mean we can't do that now??? Just hit Flag Bad Post and comment "add code tags" or some other editing problem. I don't like the …

Member Avatar for Ancient Dragon
0
206
Member Avatar for pianokey09

line 2: how is variable file declared? If it is std::string, you can't do it that way. file += ".txt" infile.open(file.c_str()) if file is declared as a character array do this: strcat(file,".txt"); infile.open(file); Your program doesn't need that for next loop. Just a while loop will do ok while(true) { …

Member Avatar for Ancient Dragon
0
156
Member Avatar for Nethran

You will have a lot easier time reading/writing the Movie structure if you replace the std::string with char arrays, something like below. std::string can not be easily written to binary files. In c++ program I like to use a constructor to initialize the data rather than initializing the data in …

Member Avatar for Nethran
0
355
Member Avatar for huntvbcode

You probably can't get legal license for VS 2008 any more, get VS 2012 Express editiion is free for both personal and commercial use. But I suspect your hardware isn't large or fast enough. [Here](http://msdn.microsoft.com/en-us/library/4c26cc39(v=vs.90).aspx) is a link to VS 2008 hardware requirements. I think you can use your current …

Member Avatar for M.Waqas Aslam
0
286
Member Avatar for Ancient Dragon

YouTube video I just saw http://www.youtube.com/watch?v=20MCxSFgrnc&feature=related

Member Avatar for Ene Uran
0
161
Member Avatar for nitin1
Member Avatar for nitin1
0
170
Member Avatar for Vish0203

Since you are new to win32 you should have read [this tutorial](http://winprog.org/tutorial/) Use [TextOut()](http://msdn.microsoft.com/en-us/library/windows/desktop/dd145133(v=vs.85).aspx) for drawing text in a window. [ Her](http://www.youtube.com/watch?v=PxSY4697w3A)e is a YouTube video that shows how to use it. [Here](http://msdn.microsoft.com/en-us/library/windows/desktop/dd144821(v=vs.85).aspx) is a list of all the font and text functions that you can use

Member Avatar for Ancient Dragon
0
4K
Member Avatar for Ranjan_1

probably because you didn't write code to do it. Sorry, but a vague question deserves a vague answer.

Member Avatar for Peter.Aye
0
56
Member Avatar for sandorlev

The const return value in that example is pointless and does nothing. The time to use const return value is when the method is returning a reference or pointer to one of it's data items, assuming you don't want the calling function to change the value. class foo() { public: …

Member Avatar for mrnutty
0
244
Member Avatar for nitin1

The vector will be slightly larger for the class's other data members. But the array of integers will be the same size. If you don't need the methods of a vector them use a normal array.

Member Avatar for ravenous
0
144
Member Avatar for harishjoy

What you want is the win32 api function [SHGetSpecialFolderPath()](http://msdn.microsoft.com/en-us/library/windows/desktop/bb762204(v=vs.85).aspx). This function is used to get path to several different operating system-dependent paths. For example if you want the path to "c:\Program Files(86)". The macro in the 3d parameter is defined in [this list](http://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx). char path[MAX_PATH]; SHGetSpecialFolderPath( 0, path, CSIDL_PROGRAM_FILESX86, FALSE …

Member Avatar for harishjoy
0
288
Member Avatar for Ancient Dragon

When my program calls MsgBox it appears in the middle of the monitor. Anyone know how to move it somewhere within the boundries of my program's window?

Member Avatar for TnTinMN
0
2K
Member Avatar for ssh9411
Member Avatar for maskinao

ListBox.SetSelected -- [click here](http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.selecteditem.aspx)

Member Avatar for Ancient Dragon
0
111
Member Avatar for syria718

Start out very simple by counting the number of letters in a sentence. When you get that finished and tested then you can write the code to count the number of words. Do just one part of it at a time so that you don't get overwhelmed by the complexity. …

Member Avatar for bhavya_best
0
3K
Member Avatar for wids101

line 31: num<=num That makes an infinite loop because num will always be equal to itself.

Member Avatar for tinstaafl
0
99
Member Avatar for Super_android

why are you using an online compiler? There are several free compilers that you can download and compile on your computer, assuming you are using your own computer instead of one located in some public place like a library or at school.

Member Avatar for Ancient Dragon
0
152
Member Avatar for thammalatha

Can you be more specific? What events? How is the ActiveX control written (MFC, ATL, or something else (what))? If the callback function is a member of a class then it must be a static method, otherwise it must be a global function.

Member Avatar for Ancient Dragon
0
83
Member Avatar for Scelus

line 59: notice the pointer is local to the constructor. As soon as the constructor ends the pointer goes away and all memory alloted to it is lost (memory leak). Correct the problem by allocating memory for the pointer that is declared in the class, like this: ` this->Participants = …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for anestistsoukalis

You need to pass a pointer to the struct declared in main(), not the struct itself. Since you declared students as an array of structs you have to tell ypologismoi() which one it needs. For example: `ypologismoi(inArxeio,&students[0],&p100,&pAll); ` If your intent is to pass the entire array, then change the …

Member Avatar for anestistsoukalis
0
988
Member Avatar for arslanh

First use ifstream object to open the file for reading. In a loop use ifstream's >> operator to read the data into each variable That's the best advice I can give you since you failed to tell us anything at all about what you have done so far to solve …

Member Avatar for Ancient Dragon
0
284
Member Avatar for asad393

[Here](http://www.codeproject.com/Articles/662/A-Beginner-s-Guide-to-the-Linked-List) is a beginners guide to linked lists tutorial.

Member Avatar for Gonbe
0
357
Member Avatar for jith125
Member Avatar for danthegreat

>Now, my first question is, do I try and run the 'burger.c' file or do i compile the created 'burger.o' file because when I try the .o file it says 'cannot execute binary file'. you don't do either. You can only run the executable. Add the -o filename to the …

Member Avatar for danthegreat
0
211
Member Avatar for andrew mendonca

Did you compile the program? Are there any compiler errors? If yes, then list a few of them. If not, did you try to run the program? Does the program produce the correct results?

Member Avatar for andrew mendonca
0
480
Member Avatar for Super_android

lines 52 and 58 attempt to declare variables with the same name. Variable names must be unique.

Member Avatar for Super_android
0
547
Member Avatar for 9tontruck

check the return value of fopen() -- its probably failed to open the file. Does the file exist in the current working directory?

Member Avatar for Ab000dy_85
0
360
Member Avatar for Sasquadge

Instead of reading the file one character at a time, read an entire line at once and then parse it to break it up into its individual parts. std::string line; while( getline(infile,line) ) { // now break the line into its individual parts }

Member Avatar for Super_android
0
174
Member Avatar for danthegreat

There is a time limit, after that you can't edit the post. Just add another post to explain the correction.

Member Avatar for deceptikon
0
163
Member Avatar for dangkhoaddt

For lines 15 and 16 it is not possible to get the length of the string because neither string is NULL-terminated. If you ended each of those strings with '\0' then func() could call strlen() to get the length of the strings. In any event, its impossible for func() to …

Member Avatar for dangkhoaddt
0
202
Member Avatar for xbat

>The consequence of that 1 downvote cause this person to downvote me 930 times for what? I thought there was a limit for the maximum times a member can up/down vote another member in the same day? Were all those downvotes on the same day?

Member Avatar for happygeek
0
238
Member Avatar for Reverend Jim
Member Avatar for Magda6347

What compiler and os are you using? Are you using MFC (Microsoft Foundation Class), Windows Forms, or some other GUI (tell us which one)?

Member Avatar for Ancient Dragon
0
112
Member Avatar for mjbor1

maybe there is a space after the second / in the last line. Leave off looking for '\0' and just check the first two characters.

Member Avatar for Ancient Dragon
0
134
Member Avatar for NewUser22

>I'm just having a heck of a time trying to figure our the answer(s) to the following questions Those aren't questions -- they are problems for you to do. Start by doing the first problem, then when that is finished do the second, etc. When you get one that you …

Member Avatar for Ancient Dragon
0
303
Member Avatar for daino

[Here](http://www.programmingforums.org/post191089.html) is a working code snippet. Just remove the const keyword when declaring data should solve the problem. `char data[] = "Callback Function called";`

Member Avatar for Ancient Dragon
0
822
Member Avatar for pars99

Do you want to change the wallpaper on the computer? [Here is a code snippet.](http://www.daniweb.com/software-development/cpp/threads/245580/vc-set-desktop-wallpaper-win-7-x64-) that works for Windows os.

Member Avatar for deceptikon
0
202
Member Avatar for kwm123

Post the code you have written so that someone can help you with any questions you may have. No one is going to just give you the solution to the program.

Member Avatar for deceptikon
0
117

The End.