344 Posted Topics

Member Avatar for stepbillz

[PhotoRec](http://www.cgsecurity.org/wiki/PhotoRec) should be able to recover any files that are still intact.

Member Avatar for nullptr
0
160
Member Avatar for refphlex

double totalSq=0, avg =0; total += num; totalSq+= (num-avg)*(num-avg); In the second loop: Isn't the declaration of `double totalSq=0, avg =0;` only in scope for this loop? Shouldn't these values just be initialised before the loop and const removed from the initial declaration of avg - `double avg = static_cast<double>(total) …

Member Avatar for refphlex
0
167
Member Avatar for Tewhano
Member Avatar for Tewhano
0
3K
Member Avatar for SpottyBlue

Change all the `for` loops in your vCount function to be like: `for (int ii = 0; ii < vowelA; ii++) // < not <=` The same for line 65. `for (int i = 0; i < nochar; i++)`

Member Avatar for nullptr
0
156
Member Avatar for strongard63

I'll attempt to explain this by showing each iteration of the while loop. int x = 125 loop 1: count = 1, x = (125/10) which = 12 loop 2: count = 2, x = 12/10 which = 1 loop 3: count = 3, x = 1/10 which = 0 …

Member Avatar for strongard63
0
2K
Member Avatar for tutonk

Scan your system with [MBAM](http://www.malwarebytes.org/), select Free version download. Then try running [ESET's online scanner](http://www.eset.com/us/online-scanner/). Their may be some manual cleanup needed once the infection is removed. Post back if you need further assistance and provide the scan logs.

Member Avatar for dee101g
0
161
Member Avatar for maiza.razzaq
Re: code

With your current approach, you are actually making this far more difficult than it is. There is no reason to use an array, all you need are two integer variables, one to hold the current input and the second to hold the sum. Then you continue to take integer input …

Member Avatar for nullptr
0
286
Member Avatar for curt.owens.5

You've already initialized count to zero, make sure you do the same for sum. I've kept the outside while loop as is to maintain your assumption that the you need to check for eof and removed the unnecessary inner loop. while ( !num_list.eof()) { num_list >> number; sum += number; …

Member Avatar for Ancient Dragon
0
152
Member Avatar for Jalaishaa

> find the product of all the positive even numbers less than or equal to 30 You're only calculating the product for positive even numbers less than 30. So it should be: prod = 1; n = 30; for (even = 2; even <= n; even += 2) prod *= …

Member Avatar for Jalaishaa
0
182
Member Avatar for zahid_3

#Include<fstream> // should be #include (all lowercase) #include<> // what's this meant to be? You should also check whether your outfile is open. if (!outfile.is_open() ) { // print an error message if you like return 1; } After writing to outfile, close it: `outfile.close();` Instead of writing the entire …

Member Avatar for nullptr
0
115
Member Avatar for andrew.mendonca.967

As tinstaafl indicated, the top of your header file should be: #ifndef MIXEDEXPRESSION_H // if not defined #define MIXEDEXPRESSION_H

Member Avatar for nullptr
0
224
Member Avatar for skyyadav

> I have to write a fn Yes you do, so what problem are you having in writing the function?

Member Avatar for mike_2000_17
0
1K
Member Avatar for mixelplik

The problem lies in: while(count < len && inputFile >> numsRead[len]) count++; You're constantly trying to read to numsRead[8] as len = 8, which is out of bounds for the array. You need to read to `numsRead[count]` You should also check as to whether the file is successfully opened using …

Member Avatar for mixelplik
0
193
Member Avatar for flony

If nombres.txt is in the same directory as the compiled executable and running under the debugger goes straight to `cout<<"algo paso"<<endl` - try running the executable outside the debugger. Some suggestions for your code. If you put `cout << linea << endl` at the top of your while loop, you'll …

Member Avatar for flony
0
204
Member Avatar for zuki88

Could you please post the code you have. The information you've provided so far isn't enough to do anything more than take wild guesses.

Member Avatar for L7Sqr
0
324
Member Avatar for andrew.mendonca.967

You need to process each word (token). while (inputFile.getline(words, 100)) { // Read each word. linecount++; token = strtok(words, " .\n"); while(token != NULL) { // process each token longestandshortestWord(token, longestword, shortestword); uniquewords(token, uniqueWords, position, uniquewordcounter); token = strtok(NULL, " .\n"); totalnumWords++; // Increment the total number of words in …

Member Avatar for nullptr
0
292
Member Avatar for freebotter

Microsoft Network Monitor will allow you to track internet activity by process name and PID. http://www.microsoft.com/en-au/download/details.aspx?id=4865

Member Avatar for nullptr
0
126
Member Avatar for andrew.mendonca.967

> Write a C++ program that reads lines of text from a file using the ifstream getline() method The ifstream getline() method, is different to the std::getline method in that it uses a `char*` - a pointer to an array of characters to hold the data, **not** a std::string object. …

Member Avatar for andrew.mendonca.967
0
728
Member Avatar for kamalashraf

You just need to cast sum as type float. float average (int sum, int size) { return static_cast<float>(sum) / size; }

Member Avatar for Ancient Dragon
0
324
Member Avatar for irtza

line 44 should be `int main()` and obviously return an int value. line 42 `int total_scores(const int [][Cols], int)` line 58 `int total_socres(const int array[][Cols], int Rows)` notice the spelling mistake? line 65 `total = total + array [Rows][Cols];` - so for each iteration you are adding array[3][3] which is …

Member Avatar for usama sadaqat
0
520
Member Avatar for Falcon143

int Clip(int Val) { return (Val < 0 ? 0 : (Val > 0xFF ? 0xFF : Val & 0xFF)); } My simple contribution.

Member Avatar for Banfa
0
2K
Member Avatar for Raja ali

Seeing as start and last are both int, you just need to cast &a[1].num1 and &a[0].num1 as type int. `start = (int) &a[1].num1;` Or quite simply you could use: `printf("\nsize of structure :%d bytes", sizeof(a[0]) );`

Member Avatar for nullptr
0
124
Member Avatar for Iggystooge
Member Avatar for coroneshotel2
0
1K
Member Avatar for Suzie999

Read the documentation on the SHELLEXECUTEINFO structure at http://msdn.microsoft.com/en-us/library/windows/desktop/bb759784(v=vs.85).aspx In particular regarding the hProcess member.

Member Avatar for Suzie999
0
996
Member Avatar for annitaz

Something like: Qstring str = textEdit->toPlainText(); // TODO convert str to uppercase textEdit->setPlainText(str); ref: http://harmattan-dev.nokia.com/docs/library/html/qt4/qtextedit.html

Member Avatar for triumphost
0
156
Member Avatar for VikashS_

The way the code is currently written, only the first expression after `if (n > 0)` will be evaluated, provided that n is indeed greater than zero. Rewriting the code using braces it would be equivalent to: x=1; y=1; if (n > 0) { x = x + 1; // …

Member Avatar for VikashS_
0
136
Member Avatar for Antriksh_1

class A { int a[]; // zero sized array }; You should receive a warning when compiling this due to `int a[]` being a zero sized array.

Member Avatar for mike_2000_17
0
243
Member Avatar for pooh1234qwerty

> i want to knw how 14.375 float is same as 14.375 double in memory but no so for 14.385. Likely because 14.375 is exactly 14 3/8 which would fit the floating point model used.

Member Avatar for nullptr
0
141
Member Avatar for Abhinisha

What are you trying to achieve in line 9 with `count 1` For a default constructor that initializes count to zero: class counter { int count; public: counter() : count(0){ } };

Member Avatar for Lucaci Andrew
0
124
Member Avatar for soche123
Member Avatar for dendenny01

In your original code you have: `for (i = 0; i < n; i++)` which increments `i` by 1 for each iteration. The solution is to increment `i` by 2 for each iteration. `i += 2 // equivalent to i = i + 2`

Member Avatar for Schol-R-LEA
0
221
Member Avatar for soche123

> try this:- > 1.ch=getch(); > 2.if(ch=='y') > 3.main(); Please do not do this. Follow Moschops link on loops. `getch()` is not standard and so shouldn't be used. Recursive calls to `main()` are simply a terrible practice and should never be done.

Member Avatar for new_developer
0
235
Member Avatar for Rasool Ahmed

Just specify a file size equal to (size of file you're mapping + size of extra data) when you call CreateFileMapping. Read http://msdn.microsoft.com/en-au/library/windows/desktop/aa366542(v=vs.85).aspx - specifically the part about File Mapping Size.

Member Avatar for Rasool Ahmed
0
707
Member Avatar for HelpWanted2115

You need to put begin and end in your while loop. While num <> 999 do begin // code for the loop goes here // end; Also line 3 isn't needed. I'll leave you to work out the rest.

Member Avatar for House_of_Dexter
0
273
Member Avatar for HelpWanted2115

Duplicate post - http://www.daniweb.com/software-development/pascal-and-delphi/threads/454365/please-help

Member Avatar for zurichy
0
164
Member Avatar for johans22

By using the key word typedef, you are just defining the struct and no memory is being allocated for it. Hence, `static test *p;` is not pointing to any valid memory location. If using a typedef for your struct use something like: typedef struct _test { int array[10]; } test, …

Member Avatar for RonalBertogi
0
170
Member Avatar for Wireboy

You need to flush the input stream after line 22. Refer to this article for the why and how - http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream

Member Avatar for nullptr
0
151
Member Avatar for Suzie999

Untested, but this should work provided you're running in the same session as the target process. if (!IsWindowVisible(hWnd)) { ShowWindow(hWnd, SW_MINIMIZE); ShowWindow(hWnd, SW_RESTORE); } SetForegroundWindow(hWnd);

Member Avatar for Ancient Dragon
0
593
Member Avatar for nova37

Use [ChangeServiceConfig2](http://msdn.microsoft.com/en-au/library/windows/desktop/ms681988%28v=vs.85%29.aspx) with dwInfoLevel of SERVICE_CONFIG_DESCRIPTION.

Member Avatar for nova37
0
221
Member Avatar for MasterHacker110

Refer to http://www.cplusplus.com/reference/cstdio/fgets/ > A newline character makes fgets stop reading, but it is considered a valid character by the function and included in the string copied to str.

Member Avatar for MasterHacker110
0
219
Member Avatar for venky019
Member Avatar for venky019
0
449
Member Avatar for AmerJamil
Member Avatar for thexile

line 9: You're trying to read everything into the same address space - `&image_read[50][100]` Try changing it to - `fscanf(myFile,"%d", &image_read[i][j]);`

Member Avatar for Ancient Dragon
0
252
Member Avatar for iEpic

You're conversion from Fahrenheit to Celsius isn't correct. Try: double celsius(double F) { return F*9.0/5.0 + 32; }

Member Avatar for nullptr
0
2K
Member Avatar for Taras20

You've got `if (isalnum(word[i]))`, which basically means if word[i] is either a letter of the alphabet or numeric, you're failing it. What you want to do is contained in Moschops reply. Check whether `isalpha(word[i])` is false. Also, when you get the new word on failure, you're not resetting `i` and …

Member Avatar for nullptr
0
419
Member Avatar for mical700

> But now how to do it with left shift command instead of multiplication? Ask yourself the following: what is the result of 1 << 0, 1 << 1, 1 << 2, 1 << 3 etc Do you notice the pattern?

Member Avatar for mical700
0
394
Member Avatar for saurabh.mehta.33234

struct aa { char a:3; // the least significant 3 bits of the char int b:30; // bits 0 to 29 of the integer char c:3; }; With regular 4 byte alignment, you'll have a, b and c each using 4 bytes = 12 bytes. > but when i replace …

Member Avatar for nullptr
0
110
Member Avatar for dustin.mcalister.58

Seeing as you're taking user input for the day, what constitutes a valid day? If I enter 3 for each day, what happens to every other entry in the array? What happens if I enter day values far beyond the bounds of the array? How about non numeric input? If …

Member Avatar for nullptr
0
180
Member Avatar for $Tweety$

Yes, I could indeed do that. Could you perhaps be a little more specific as to what a tough program is?

Member Avatar for vmanes
0
260
Member Avatar for nova37

I gather your using TCHARs and most likely compiling as _UNICODE, so try: HRSRC hRes = FindResource (NULL, TEXT("ID_LIBMYSQL"), TEXT("RT_RCDATA") );

Member Avatar for nova37
0
337

The End.