15,300 Posted Topics

Member Avatar for emildekeyser

>>while(desktop = NULL); That will produce an infinite loop because you want to use the boolean == operator, not the assignment = operator. And what's the point of those do loops anyway? If FindWindow() returns NULL the first time it will always return NULL. Calling FindWindow() again isn't going to …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Creator07

you can not just typecase from char* to wchar_t*. You have to call one of the transformation functions. This works ok for me when the program is not compiled for UNICODE [code] #include <iostream> #include <cstring> using namespace std; int main() { char S1[] = "C:\\Program Files" ; char S2[]= …

Member Avatar for Creator07
0
154
Member Avatar for amirun

you have to use some of the [URL="http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx"]Windows Console[/URL] functions. But they are not available if you are using an ancient 16-bit compiler. If that is true then upgrade to a new free 32-bit compiler, such as Code::Blocks or VC++ 2008 Express.

Member Avatar for Ancient Dragon
-1
58
Member Avatar for AlexRamallo

1. Read the value at that registry setting. If you are using non-managed code (normal c++) then you can refer to any of [URL="http://www.google.com/search?hl=en&rlz=1G1GGLQ_ENUS328&q=windows+registry+c%2B%2B+tutorial&btnG=Search&aq=f&oq=&aqi="]these links[/URL] for more information. 2. Assuming it is a path to a file, just use standard C function remove() to delete it. 3. You will also …

Member Avatar for Ancient Dragon
0
230
Member Avatar for seao111

Here is one way to retired the output of that program to a file. If all you want is to get it into your program then do the same thing here buf save the strings in an array or vector<string> [code] #include <stdio.h> #include <iostream> #include <fstream> using namespace std; …

Member Avatar for Ancient Dragon
0
130
Member Avatar for himgar

add something to the end of the program that makes you enter a key, such as cin.get() -- btw the problem is your program, not the IDE.

Member Avatar for siddhant3s
0
327
Member Avatar for tiger86

Use which ever language you like the best. If you download the DirectX SDK from M$ it contains several example programs and I think they are written in c++. >>Also is the mouse in windows written in c or C++? There are no win32 api functions written in C++. M$ …

Member Avatar for vegaseat
0
203
Member Avatar for krishnampkkm

[QUOTE=krishnampkkm;895587]Hiii [B] How to use SHFileOperation() ?[/B] u have any direct link to it... thanking u..[/QUOTE] You mean like [URL="http://lmgtfy.com/?q=+SHFileOperation"]this one[/URL]?

Member Avatar for marco93
0
104
Member Avatar for JugglerDrummer

The site has been very slow for everyone today -- I even got database error messages a couple times.

Member Avatar for MidiMagic
0
241
Member Avatar for fghdmhmmd
Re: SLR

this is not a C program because it includes iostream.h, which is an old obsolete file.

Member Avatar for jephthah
0
221
Member Avatar for goody11

Possibly lack of code guards is the problem. [code] #ifndef MYHEADER_H #define MYHEADER_H // other stuff here #endif [/code] [edit]what ^^^ said [/edit]

Member Avatar for goody11
0
392
Member Avatar for djustus1

you could use standard C function qsort(), c++ std::sort(), or write your own sort algorithm.

Member Avatar for djustus1
0
127
Member Avatar for Alicito

you could use stringstream class in <sstream> [code] string sentence = "Now is the time for all old folks to be in bed"; string word; stringstream str(sentence); while( str >> word) cout << word << "\n"; [/code]

Member Avatar for tux4life
0
340
Member Avatar for Zay

you don't need a loop or switch statement. use string's substr() method to extract the first two characters and again to get the last two characters.

Member Avatar for Lerner
0
118
Member Avatar for scrappy
Member Avatar for DavidJ12345

You have to compile all programs for release mode before attempting to run them on other PCs. The DLLs you mentioned are for debugging on your PC only with your compilers.

Member Avatar for DavidJ12345
0
135
Member Avatar for timb89

you can use the macro isdigit() to find out if it is '0' to '9'. And the At() method is unnecessary. [icode]if( isdigit(word[i]) )[/icode]

Member Avatar for Ancient Dragon
0
1K
Member Avatar for aramakri

I think it doesn't know what [b]string[/b] is, and I don't think you can pass string objects as parameters to COM functions. Change [b]string[/b] to [b]char*[/b] and see if that fixes the problem. >>What does "in" mean in your function by the way? In COM programming there are [b]in[/b] parameters, …

Member Avatar for jencas
0
141
Member Avatar for ultrAslan

Have no idea how to help you because I don't know what Multiply() and Power() do. And that is one of the weirdest programs I have seen in a long long time. [b]program_body[/b] instead of [b]int[/b] ??? Only a university professor would dream of writing such confusing and unconventional crap.

Member Avatar for siddhant3s
0
186
Member Avatar for gretty

Attempting to compare a single character with a string. Here is how to fix it -- use single quotes instead of double quotes [icode] array[i][0] == ' '[/icode]

Member Avatar for tux4life
0
89
Member Avatar for krishnampkkm

do you want ms-windows or *nix? Sample code for both [URL="http://www.daniweb.com/code/coder46588.html"]are here.[/URL]

Member Avatar for krishnampkkm
0
105
Member Avatar for bharanidharanit

open first input file A open output file read input file A (probably use fgets() ) write to output file (using fprintf() or fputs() ) close input file A open input file B repeat the above for B close both files and you are done :) You need to study …

Member Avatar for Ancient Dragon
0
128
Member Avatar for Vicky21

There is no such concept as HttpSession in c++. When you logon in java I presume the java code checks a database, such as MySQL, for login credentials. If username and password are verifyed then the user is allowed to continue using the program. C++ programs can do the same …

Member Avatar for Ancient Dragon
0
68
Member Avatar for bharanidharanit

[QUOTE=Tom Gunn;894029]. "rt" isn't portable.[/QUOTE] Whatever gave you that idea? True, text mode is the default, but there is nothing wrong with specifying 't' in the mode string. If there was then it would be in the c standards.

Member Avatar for Dave Sinkula
0
357
Member Avatar for BradenMurphy

I assume you mean in MS-Windows operating system. You would not want to do that even if you could because it would not allow the user to easily select a different desktop icon, the start menu, or any of the icons in the desktop trey. And that would piss off …

Member Avatar for BradenMurphy
0
2K
Member Avatar for Niner710

Are those four different integers? Looks like a normal text file to me, not a binary file. If it were binary file then you wouldn't be able to read those integers. Try this: [code] int x; infile.read( (char*)&x, sizeof(int)); [/code] or this [code] char* buffer = new char[4]; infile.read(buffer, 4); …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for julia2009

There are several ways to accomplish that -- functions in stdio.h or iostream. For example: [icode]cin.get()[/icode]

Member Avatar for ArcRoyal
0
1K
Member Avatar for girl_pt

Reading that file is not difficult as long as the records are separated by '\n' or '\r\n', depending on the os. The code below will read each line then split it up with the semicolons as deliminators. [code] FILE* fp = fopen("file.txt","r"); char buf[255]; while( fgets(buf,sizeof(buf), fp) != NULL) { …

Member Avatar for Dave Sinkula
0
104
Member Avatar for blud

[QUOTE=niek_e;893568]I almost flagged this thread as spam due to the enormous amount of iPod spam posted on daniweb lately :)[/QUOTE] And I was about to delete it :)

Member Avatar for Ancient Dragon
0
124
Member Avatar for seao111
Member Avatar for jencas
0
103
Member Avatar for gwen73

[QUOTE=gwen73;893261]I am sorry but I do not know how to use code tags [/QUOTE] Then you are not paying attention. You had to type right over the instructions when you typed that post. The instructions are also provided when you signed up, and again at the top of every DaniWeb …

Member Avatar for s_sridhar
0
166
Member Avatar for gergep

You need to use function pointers. Here is a simple example where you type the name of the function you want to execute at the keyboard. Since C and C++ and not interpreted languages you can not execute code that has not already been compiled in the program. [code] #include …

Member Avatar for gergep
0
132
Member Avatar for vishalonne

>> static int code,a,c,p,m,d,e,h,f,z; You forgot to declare [b]code[/b] globally like you did the others

Member Avatar for monkey_king
0
208
Member Avatar for jusmeehh

>>Any advice or tip will help out. Thank you Your program contains hard-coded data, but the requiremenets state it must read the data from a data file. That's the first thing you need to do -- get that working first then continue on with the next item in the requirements …

Member Avatar for jusmeehh
0
177
Member Avatar for newToC

>>wsprintf Are you compiling this program for UNICODE? If not, then why are you calling the unicode version of sprintf()? I know this doesn't answer your question, I don't know the answer.

Member Avatar for newToC
0
172
Member Avatar for vishalag
Member Avatar for hypernova

change "%u" to "%p" and rerun your program. Also, the way to insure there are no holes in the structure is to use the [icode]#pragma pack(1)[/icode] [code] #pragma pack(1) struct emp { int age; char name[6]; } e; #pragma pack() int main() { printf("%p\n",&(e.age)); printf("%p\n",(&(e.age)+0)); printf("%p\n",(&(e.age)+1)); printf("%p\n",(&(e.age)+2)); printf("%p\n\n\n",(&(e.age)+3)); printf("%p\n",(&(e.name)+0)); printf("%p\n",(&(e.name)+1)); …

Member Avatar for s_sridhar
0
124
Member Avatar for dephrate
Member Avatar for Ancient Dragon
Member Avatar for Ancient Dragon
0
36
Member Avatar for monkey_king

you could do this: Also, its not necessary to surround function calls with parentheses. [code] int main(int argc, char** argv){ [color=red] char sdsd[] = "asf/asdf";[/color] printf("%s\n",sdsd); fix_name(sdsd); printf("%s\n",sdsd); return 0; } [/code]

Member Avatar for monkey_king
0
189
Member Avatar for muthuveerappan

since ptr2 is a reference to ptr1, when you change ptr1 the change is also reflected in ptr2. What you can't do with ptr2 is assign a new value to it like [icode]*ptr2 = 2;[/icode] is an illegal statement because ptr2 is a const.

Member Avatar for Ancient Dragon
0
93
Member Avatar for atman

>>reinterpret_cast is the recommended way over anonymous unions. reinterpret_cast is not allowed in C. So I don't know where you got your information but its wrong. The only place I've used anonymous structs is inside a union [code] union something { struct { int x; int y; }; unsigned char …

Member Avatar for Ancient Dragon
0
191
Member Avatar for SanojMathew

compile both for debug and use your compiler's debugger to find out the problem. Does your program use LoadLibrary() to load the dll into memory? Then GetProcAddress() to get pointer to a function? Make sure that function pointer is not NULL.

Member Avatar for SanojMathew
0
99
Member Avatar for mimi_ted

[QUOTE=mimi_ted;891611]hi everybody. i need to to know where to start developing my hard ware knowledge. mimi[/QUOTE] In school. And Welcome to DaniWeb.

Member Avatar for debasisdas
0
17
Member Avatar for cwarn23

All versions, including the Express edition, has Windows Forms. To start a new project click File --> New --> Project --> CLR, then in the Templates window click Windows Forms Application >>BTW, I am actually going to buy one of these versions but the pro edition is a bit pricy. …

Member Avatar for cwarn23
0
131
Member Avatar for lotrsimp12345

post an example of the input string because I don't have a clue what that code (lines 23-39) is attempting to do.

Member Avatar for s_sridhar
0
334
Member Avatar for TheNNS

Ubuntu may be ok for just casual users, but is terrible for c/c++ programming. I tried it on my computer, easy to install but does not include any developers tools such as GNU compilers. I now use fedora 5 which is a lot more complete. Don't know anything about the …

Member Avatar for krnekhelesh
0
776
Member Avatar for CppFTW

Is the file more than 2 gig in size? Can you replicate the problem using the same file with a program that just calls those two functions?

Member Avatar for CppFTW
0
2K
Member Avatar for ippomarley

There is an error in the airport1.txt file on line 90 [icode]SYD BNE 07:30 1:00[/icode] getline() reads it in as [icode]SYD BNE07:30 1:00[/icode] -- missing the space between BNE and 07:30. I re-typed the line and the program continued to work from there until the next error, which was at …

Member Avatar for ippomarley
0
220
Member Avatar for mathueie

It would be helpful if you told us which line the error occurred on so that we don't have to read the whole program to find out.

Member Avatar for mathueie
0
2K

The End.