15,300 Posted Topics

Member Avatar for CPT

We're not going to do your homework for you. (1) if the head is NULL -- this is a simple assignment statement. allocate memory for the new node then assign its pointer to the list's head. (2) head already exists: You want to add the new node to the tail …

Member Avatar for Ancient Dragon
0
158
Member Avatar for Adrop

1. Learn to use code tags. The code you posted is almost impossible to read without them. 2. What is the problem with your program? What does it not do that you want it to do? Are there any compiler errors? If yes, then what are thy?

Member Avatar for Ancient Dragon
0
241
Member Avatar for saloth

how is sign and RsvrdWrd declared? As for the extra character -- why don't you try reading the file into std::string object then copying the info to the RsvrdWrd. [code] void loadR() { ifstream file; std::string line; file.open("C:/CaseStudy/CaseStudy/Rsrvd.txt",ios::in); for (i=0; i<44; i++) { getline(file, line); strcpy_s(sign[i].RsvrdWrd, 12, line.c_str()); //file.getline(sign[i].RsrvdWrd,13,'\n'); } …

Member Avatar for ftl25
0
194
Member Avatar for Ancient Dragon

When you move a thread here in DaniWeb Community Feedback I wish the mods would leave no redirect links. Its rather annoying to see all those moved threads, they just clutter up the list with useless links.

Member Avatar for ~s.o.s~
0
110
Member Avatar for CodyOebel

In WinProc() cature the [URL="http://msdn.microsoft.com/en-us/library/ms646242(v=VS.85).aspx"]WM_RBUTONDOWN[/URL] event. lparam contains the mouse coordinates.

Member Avatar for CodyOebel
0
142
Member Avatar for Rahul.menon
Member Avatar for Dani

I used to read it, but have not seen the link with this new design. I posted a complaint about that but I suppose it got lost in the shuffle. There used to be a link at the bottom of each page, near the About Us line.

Member Avatar for Ancient Dragon
0
662
Member Avatar for widapol

The NULL character is '\0', or just simply 0. Use while loop to check each character in the string.

Member Avatar for zark_yoc
-1
233
Member Avatar for WASDted

Very intereting :) >> and he is confident in Intel's ability to generate plenty more cash. Who said we are in a recession? Apparently Intel isn't. I hope they are putting all that cash to good work that create new jobs instead of just putting it under their mattress for …

Member Avatar for Ancient Dragon
1
347
Member Avatar for gracy1011

You can get handles to all windows, which ones would have .mpp files I don't know. See win32 api function [URL="http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx"]EumWindows()[/URL]

Member Avatar for Ancient Dragon
0
46
Member Avatar for Jishnu

Interesting. On MS-Windows I get the same results that you got on Solaris, which is correct. That book is wrong. The operating system may read into memory any amount of the file it wants to (buffering), but the file pointer only moves to the location requested in the program. There …

Member Avatar for Jishnu
1
594
Member Avatar for Lerner

>> It should be a multiple of 4 bytes. Depends on the compiler and how it aligns the structure object. You can change the alignment with most modern compilers so that it is 1, 2, 4, 8, 16, 32 etc aligned. The default alignment is compiler dependent too.

Member Avatar for Lerner
0
158
Member Avatar for kuen

Q1: That doesn't work because what you have to do is extract each of the digits from an integer. If you enter 1234 then you have to count each digit 1, 2, 3, and 4. Use the % (mod) operator and / to do that. This isn't the complete code …

Member Avatar for kuen
0
117
Member Avatar for ToRtUgOxX
Member Avatar for haggard433

I see that is an MFC program. What version of the Microsoft compiler are you using? If you want anyone to test out your program you need to zip up the entire project directory and upload it here (us the Advanced Editor options to do that). But first delete all …

Member Avatar for haggard433
0
134
Member Avatar for oscarp

sleep() takes whole integers. You can't pass 0.99 and expect it to do anything because 0.99 is converted to just 0. If you want to sleep less than one second then use nanosleep()

Member Avatar for Ancient Dragon
0
86
Member Avatar for malvi

Not specific to MFC. Just add .5 and take the integer part [code] int main() { float f = 1.67F; f += 0.5F; f = float((int)f); std::cout << f << '\n'; } [/code]

Member Avatar for Ancient Dragon
0
67
Member Avatar for Akilah712

check_month() is incorrect. November has only 30 days, not 31. class data objects: I think all you need are current_day, current_month, and current_year. You don't really need any of the others. add_years() for example should be coded like this: [code] //add years to default date void add_years (int num_years) { …

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

You mean the + operator? [code] class MyClass { private: int x; public: MyClass() {x = 0;} MyClass operator+(int x) { MyClass n = *this; n.x = n.x + x; return n; } }; [/code]

Member Avatar for Fbody
0
225
Member Avatar for NV43
Member Avatar for NV43
0
108
Member Avatar for aviavyne

I would get the input data as a string, then check each character to see that it is a numeric digit 0-9 or a . for floats (and there can be only one dot in the string). If it passes that test then convert the string to a float.

Member Avatar for Akill10
0
152
Member Avatar for JWebster

The file is probably not in the current directory. either use getline() so that you can enter the complete path to the file, or move the file into the current working directory, which is where the *.cpp file is located. Also make sure you spell the file name correctly -- …

Member Avatar for Ancient Dragon
0
100
Member Avatar for LevyDee

Did you read [URL="http://msdn.microsoft.com/en-us/library/ms646977(v=VS.85).aspx"]this?[/URL], especially [URL="http://msdn.microsoft.com/en-us/library/ms647988(v=VS.85).aspx"]InsertMenuItem[/URL]()

Member Avatar for LevyDee
0
111
Member Avatar for nirali7

Your program is also inconcistent in the way it declares std namespace. If you don't use [icode]using namespact std;[/icode] or [icode]using std::vector;[/icode] then you have to preface every instance of vector with std::, such as [icode]std::vector< std::vector< std::string> > something;[/icode] As for the parameter tokens -- unless that is an …

Member Avatar for nirali7
0
3K
Member Avatar for Mouche

>>I would like to use this tasklist for a cli interface and then change it to a GUI AFAIK CLR is only supported by c++, not C. So you might as well switch to c++ now if your intent is to use it in a c++/clr project.

Member Avatar for abhimanipal
0
151
Member Avatar for linta

[QUOTE=linta;1010975]plz help me 2 finish my c++ proj on supermarket.i need the exact details of the funcns,sub calculatns............. urgent[/QUOTE] How urgent is this? Deposit $100,000 USD into my paypal account and I'll help you out.

Member Avatar for prvnkmr449
-6
216
Member Avatar for VBNick

With the loop counter declared as unsigned short what will your program do if n_elements is 0? I would think that declaring the loop counter as int would be a lot safer. If n_elements is an unsigned int then you might want to typecast it to int in order to …

Member Avatar for William Hemsworth
0
173
Member Avatar for Kostan M

You can not use graphics.h with that compiler. If you want to draw curves then you will have to [URL="http://www.phrases.org.uk/meanings/bite-the-bullet.html"]bite the bullet[/URL] and learn win32 api programming, or learn MFC.

Member Avatar for Ancient Dragon
0
45
Member Avatar for nigelmercier

Is there a reason you are using strings instead of simple integers? It would be a lot simpler to manipulate an integer then convert it to a string for display purposes. [code] #include <stdio.h> #include <string.h> int main () { int x = 39989; char result[80]; for(int i = 0; …

Member Avatar for mitrmkar
0
346
Member Avatar for Glass_Joe

Oh so now you insult 99.9% of today's young people :) I see you are becoming very popular here at DaniWeb where most members are below the age of 25.

Member Avatar for Ancient Dragon
4
9K
Member Avatar for RaoxFaello

It's [b]Pig Latin[/b], not piglakin. Read [URL="http://en.wikipedia.org/wiki/Pig_Latin"]this wiki article [/URL]to see how to convert English words into pig latin. It will not give you the c/c++ code, but will show you what you have to do.

Member Avatar for Ancient Dragon
0
103
Member Avatar for eduard77

It's not necessary to store all the even numbers. All you have to do is add the value of the loop counter to the sum accululator if the loop counter is even.

Member Avatar for Ancient Dragon
0
85
Member Avatar for TetuGal
Member Avatar for ruwanithanu
0
382
Member Avatar for challarao

Read about the format specifiers! The 2 in %2d says to display the integer in 2 or more characters. For example if x = 1, then it will show a space before the 1, like in " 1". But if x = 123 then it will just show all the …

Member Avatar for creeps
0
101
Member Avatar for Mossh
Member Avatar for Mossh
0
190
Member Avatar for David_Omid

Is is a console or gui program? How are you displaying the number? If you are displaying floats then use fixed [code] #include <iostream> #include <iomanip> using namespace std; int main() { float x = 1000000000000000.0F; cout << x << '\n'; cout << fixed << x << '\n'; } [/code]

Member Avatar for David_Omid
0
105
Member Avatar for eduard77
Member Avatar for viralthanki
Member Avatar for Ancient Dragon
0
16
Member Avatar for malvi

Assuming you have a pure win32 api program, send [URL="http://msdn.microsoft.com/en-us/library/ms632627(v=VS.85).aspx"]WM_GETTEXT[/URL] message.

Member Avatar for Ancient Dragon
0
229
Member Avatar for fire_

.bmp files are binary files, not ascii text files. You have to open the file with ios::binary flag and then use ifstream's read() method to read the binary data. getline() will not work. And you will have to read the file into a character array, not a std::string object [code] …

Member Avatar for fire_
0
159
Member Avatar for Mehh

I'm not surprised. All you posted is a bunch of meaningless lines of code. Try writing a real program with functions etc.

Member Avatar for Ancient Dragon
-1
174
Member Avatar for itsmeisuru

it doesn't work because you have to use sprintf() to format the string. [code] char command[255] = {0}; sprintf(command,"copy %s.jpg \\%s\\%s.jpg" , a, a, a); [/code]

Member Avatar for itsmeisuru
0
108
Member Avatar for priyanka.js28

Even without optimization it will be compiler dependent. You can test that out for yourself by having your compiler generate the assembly code and see for yourself what it does with it. [code] int main() { int x[5] = {1,2,3,4,5}; int* p = x; p++; p = p + 1; …

Member Avatar for SaiBalaji
0
430
Member Avatar for virtualvictory

what compiler are you using? Most modern compilers have debugging facilities that let you execute the program one line at a time and view the current value of variables.

Member Avatar for Ancient Dragon
0
78
Member Avatar for Parthmishr

instead of "0x" for hex use use "0o" for octal, which is consistant with "%0o" in the printf() format specifier.

Member Avatar for Ancient Dragon
0
72
Member Avatar for malvi

Since you are using MFC then call [URL="http://msdn.microsoft.com/en-us/library/49313fdf(VS.80).aspx"]SetTimer()[/URL] The last parameter is the name of the function you want it to call. See the example in the link.

Member Avatar for Ancient Dragon
0
168
Member Avatar for chandrut

ODBC is the way to go if you want a program to be able to connect to a variety of SQL-compliant databases, such as Access, MySQL, Oracle, Sybase, etc. etc. See the links that Narue posted. But if you have a specific database in mind then you might get better …

Member Avatar for Ancient Dragon
0
119
Member Avatar for dflatt

Is it possible to do what? There is no restriction on the number of getters you can put in a class.And you have to put { and } around all functions even if they are only one line. I always make one liners inline code instead of in an implemnentation …

Member Avatar for Ancient Dragon
0
133
Member Avatar for User4699

It only prints the last name that was input because when cin >> name is called cin will erase the current contents if name and replace it with the new keystrokes. If you want to keep all the names in memory then you will have to put them in an …

Member Avatar for Ancient Dragon
1
165
Member Avatar for ToiNKieZ

scnaf(%s stops processing keyboard input when it encounters the first space. If you want to include space when use fgets() instead of scanf() [code] fgets(name, sizeof(name), stdin); // now remove the trailing carrage return '\n' if( name[strlen(name)-1] == '\n') name[strlen(name)-1] = '\0'; [/code]

Member Avatar for ToiNKieZ
0
127

The End.