432 Posted Topics

Member Avatar for Suzie999

As my project is growing, i've found myself needing to employ a new thread to carry out a loop task for the lifespan of my program. It all works seemingly well except for when I exit it. It dosent close cleanly. By that I mean I have to press SHIFT+F5 …

Member Avatar for ian.chou.12
0
130
Member Avatar for swaar.metaal.7

I'm quite the novice but are chars not just unsigned int values anyway? for example... char c = 0x41; // A cout << c <<endl; getchar();

Member Avatar for swaar.metaal.7
0
279
Member Avatar for yann.bohbot.9

I'm not entirely sure what your goal is from your words. So this is a guess. int main(){ int arr[10]; int *ptr; int i; ptr = arr; printf("Enter 10 integers:\n"); for (i=0; i<5; i++){ printf("arr[%d]: ", i); scanf("%d", ptr); ptr++; } for (i=4; i>=0; i--) { ptr--; printf("arr[%d] = %d\n", …

Member Avatar for sepp2k
0
129
Member Avatar for rron17

Is that just a random piece of code you found? In your code proper. `cout << "Your name is: " << firstmame[0] << "." << surname << endl;`

Member Avatar for ddanbe
0
161
Member Avatar for COKEDUDE
Member Avatar for hafza.sana

Here at daniweb, you're expected to make an initial effort, and pose relative questions.

Member Avatar for David W
0
153
Member Avatar for COKEDUDE

I cannot imagine you could not find the first link in a google search. http://en.wikipedia.org/wiki/Unistd.h Also, if you don't know what it is, you don;t need it.

Member Avatar for COKEDUDE
0
132
Member Avatar for learner_new
Member Avatar for Labdabeta
Member Avatar for cnsk90
Member Avatar for David W
0
780
Member Avatar for Tinnin
Member Avatar for Dang_1

Try adding to main.cpp #include <iostream> using namespace std; If not solve issue, tell what Compiler/IDE and OS/Version you use.

Member Avatar for Dang_1
0
158
Member Avatar for Emma_3

Don't know if thisa is best way, but appears to work for me. #include "stdafx.h" #include <iostream> #include <cctype> using std::cout; using std::cin; using std::toupper; char firstname[15], lastname[15]; int main() { cout << "Enter your last name: " ; cin >> lastname; cout << "Enter your first name: " ; …

Member Avatar for Suzie999
0
220
Member Avatar for Isabella Angeliese

isupper is failing, vs2010 same error. isctype.c #if defined (_DEBUG) extern "C" int __cdecl _chvalidator( int c, int mask ) { _ASSERTE((unsigned)(c + 1) <= 256); //<<<<<<<<<<<<<<<<< here return _chvalidator_l(NULL, c, mask); } does it expect unsigned char?

Member Avatar for Ancient Dragon
0
814
Member Avatar for fortranlover
Member Avatar for richkardmunga.hounarable
Member Avatar for Suzie999

I am wrapping the Windows API CreateProcess. Here is my code. int __stdcall _Execute(LPTSTR program, LPTSTR workingdir, WORD show){ // Check if program has content if (!program || !*program){ MessageBox(NULL, L"You must provide path to executable", L"Error", MB_OK); return 0; } // Create buffers and copy program param to szCmd …

Member Avatar for Suzie999
0
324
Member Avatar for V3N0M

Can't test at the moment, but try this. #include <stdio.h> #include <string.h> #include <ctype.h> int main(int argc, const char * argv[]) { char name[10]; int x = 0; //get user input of name printf("Enter your name: "); scanf("%s",&name[10]); printf("Your name has %lu letters.", strlen(&name[10]));//Length //Having problem over here I need …

Member Avatar for Ancient Dragon
0
180
Member Avatar for tawanda_1

Thanks for letting us know. Post your code if you get stuck. here's a quick example of what a) could be. double _a(double A,double B,double C,double D,double E){ return A + B + C + D + (E / 5); }

Member Avatar for ann.mughal.5
0
305
Member Avatar for V3N0M

Sure it can, but it would be better, quicker, and of more value to you, if you wrote your own from scratch.

Member Avatar for Suzie999
0
151
Member Avatar for mixelplik

You could count the spaces, and add 1. That's assuming there are no leading or tailing spaces.

Member Avatar for mixelplik
0
326
Member Avatar for willyah

You forgot to mention you are a C beginner like in your other 4 threads. I would advise you not take on such complicated projects as a beginner. If you choose to do so anyway, then it's best to post the code you have tried.

Member Avatar for Suzie999
0
2K
Member Avatar for alexandru.caplescu
Member Avatar for Suzie999
0
1K
Member Avatar for Vish0203
Member Avatar for javed.iqbal.3979
Member Avatar for folabidowu

Can get you started... #include <iostream> You're going to need a "main" function. cin. cout. and a bit of mathematics.

Member Avatar for Banfa
0
791
Member Avatar for Suzie999

Hi, I am currently writing a library for dynamic use, and in it I have some string functions. This particular one returns a substring of a given string from the rightmost, determined by a given count. I just get the feeling that I'm missing some error checking and would like …

Member Avatar for Suzie999
0
295
Member Avatar for Suzie999

Hi daniwebbers. I've been hearing a lot about Qt when searching for a library to ease my pain of creating GUI's with native windows API. I'm hoping folks here might be able to offer some sage councel before I do something irreversible to my IED environment (vs 2010) that I'll …

Member Avatar for Ancient Dragon
0
543
Member Avatar for Suzie999

I'm attempting to automate work on an external webpage. One particular element refuses to respond unless the mouse cursor is above it, which means the automation fails. I have tried firing events such as onmouseover, onmousedown etc.. but nothing appears to work unless the system mouse cursor is above the …

Member Avatar for JorgeM
0
92
Member Avatar for Ravneet_1
Member Avatar for castajiz_2
Member Avatar for Samier999

Create a string array similar to below `std::string sArray[10][3];` Use cin or similar to populate the elements of that array. Post here, your attempts.

Member Avatar for richieking
0
351
Member Avatar for Rickname
Member Avatar for Suzie999

I found myself needing a threadsafe global variable to indicate when a thread is complete. Quickly discovered `std::atomic<type> var(val);` only to find it has no support in my IDE. Can anyone offer an alternative? I have an operation that needs to be carried out which takes some time, I cannot …

Member Avatar for rubberman
0
739
Member Avatar for toniann.midori
Member Avatar for cmps
0
123
Member Avatar for Suzie999

Trying to put inline functions in external file within project, and getting below errors. If I remove "__forceinline", then all is well. If I have the inline function in main cpp file and not in header, it is fine also. Is there a procedure to deal with this? file.h __forceinline …

Member Avatar for Suzie999
0
1K
Member Avatar for Dani

As an occasional visitor to daniweb, I have to say I never even noticed a change in software, and thought that popup think when posting was just an addition. What I have noticed in other places I visit regularly is that activity drops come spring/summer time. Whether that contributes to …

Member Avatar for Dani
0
2K
Member Avatar for sireiz

There are are many examples of brute force methods here in the forums. Just put "Brute force" into search field.

Member Avatar for Suzie999
0
84
Member Avatar for sevin1192

> In object-oriented programming, a friend function that is a "friend" of a given class is > allowed access to private and protected data in that class that it would not normally > be able to as if the data was public. http://en.wikipedia.org/wiki/Friend_function

Member Avatar for Suzie999
0
111
Member Avatar for Suzie999

A short while ago I was intrigued by a reply made by nullptr in [this thread](http://www.daniweb.com/software-development/cpp/threads/458583/shellexecuteex-api). So I began to look for ways to access the rest of IE (IWebBrowser2) interface, and met limited and varied success. Accessing for instance a <div></div> element in a wep page html document was …

Member Avatar for Suzie999
0
270
Member Avatar for Lp_baez

There are no infinate loops in that code, it would be best if you could show the relevent loop.

Member Avatar for Lp_baez
0
1K
Member Avatar for Suzie999

I'm trying to embed a window into my own. I somehow new it would not be as simple as it sounded, so I'd like a pointer where else to look if anyone can help. hMyOwnWindow //HWND hExternalWindow // HWND //size the external window so it will fit. MoveWindow(hExternalWindow,19,102,383,400,true); //set style …

Member Avatar for Suzie999
0
4K
Member Avatar for Suzie999

I'm running this code. SHELLEXECUTEINFO ExecuteInfo = { 0 }; ExecuteInfo.cbSize = sizeof(ExecuteInfo); ExecuteInfo.fMask = 0; ExecuteInfo.hwnd = nullptr; ExecuteInfo.lpVerb = L"open"; ExecuteInfo.lpFile = L"C:\\progra~1\\intern~1\\iexplore.exe"; ExecuteInfo.lpParameters = L"http://www.google.co.uk"; ExecuteInfo.lpDirectory = nullptr; ExecuteInfo.nShow = SW_SHOW; ExecuteInfo.hInstApp = nullptr; ShellExecuteEx(&ExecuteInfo); Sleep(5000); CloseWindow((HWND)ExecuteInfo.hwnd); exit(GetLastError()); It's not closing the window. And it's exiting with …

Member Avatar for Suzie999
0
1K
Member Avatar for lewashby

To be honest I'm having trouble making any sense of the code, but I would suggest that what you are outputting is the decimal values of the characters contained in processTheseThree.

Member Avatar for vijayan121
0
231
Member Avatar for Suzie999

When I visit a section of the forums and look at a single thread, when I return to it's index page all threads are marked as read. Anyone have a solution to this?

Member Avatar for Suzie999
0
282
Member Avatar for efe.ozyer

I'm not entirely certain of your goal from your post, or the platform on which you work. But I'm using windows, and would start with the WINAPI [EnumThreadWindows](http://msdn.microsoft.com/en-us/library/windows/desktop/ms633495?v=vs.85.aspx)

Member Avatar for Suzie999
0
176
Member Avatar for Suzie999

Hi. Parden me if I do not express my question very well. A project I am considering would benefit greatly from the ability to to compile a dll at runtime, on machines which may or may not have appropriate tools installed (so I may be looking at using third party …

Member Avatar for Suzie999
0
190
Member Avatar for omidex

In windows API you can use [GetPixel](http://msdn.microsoft.com/en-us/library/windows/desktop/dd144909(v=vs.85).aspx)(...) function.

Member Avatar for Suzie999
0
130
Member Avatar for bebesilang

> i just dont know how to insert the "arp" two times in a single string Insert in once, and then insert it once.

Member Avatar for Suzie999
0
357
Member Avatar for Suzie999

Hi. In a project of mine, I have many different files 1.h, 1.cpp, 2.h, 2.cpp, 3.h, 3.cpp etc. Some of the functionality in them depend on veriables or functions in the others. If I juggle the #includes around I can get around most of it, for instance, if functionality in …

Member Avatar for Suzie999
0
203

The End.