Click here to Skip to main content
15,895,822 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c++ with QT exe file error Pin
Mkhitar_Sargsyan14-Aug-13 19:59
Mkhitar_Sargsyan14-Aug-13 19:59 
Questionhow to get hash of account's password Pin
sr333012-Aug-13 19:42
sr333012-Aug-13 19:42 
AnswerRe: how to get hash of account's password Pin
Richard MacCutchan12-Aug-13 20:50
mveRichard MacCutchan12-Aug-13 20:50 
GeneralRe: how to get hash of account's password Pin
sr333013-Aug-13 0:15
sr333013-Aug-13 0:15 
GeneralRe: how to get hash of account's password Pin
Richard MacCutchan13-Aug-13 0:39
mveRichard MacCutchan13-Aug-13 0:39 
AnswerRe: how to get hash of account's password Pin
ngtv12-Aug-13 23:53
ngtv12-Aug-13 23:53 
GeneralRe: how to get hash of account's password Pin
sr333013-Aug-13 0:16
sr333013-Aug-13 0:16 
Questioni'm tring to initialise a sudoku board (9*9) using c++.getting a blank screen with blinking cursor as output. Pin
Member 1019329312-Aug-13 6:47
Member 1019329312-Aug-13 6:47 
#include <iostream>
#include<ctime>
#include<cstdlib>
using namespace std;


/* here array board[][] is declared to be a global variable*/
int board[9][9];

/* this function returns a random number in the specified range(excluding the upper limit)
in this program,returns random number between 0 and 8 */

int randrange(int low,int high)
{
return rand()%(high-low)+low;
}


bool check(int num,int row,int col)
{
int i;
// checks if number is repeated in that row or not

for(i=0;i<9;i++)
{
if(board[row][i]==num)
{
return false;
}
}

// checks if number is repeated in that column or not

for(i=0;i<9;i++)
{

if(board[i][col]==num)
{
return false;
}
}
return true;
}


/* this function checks if that particular element in the array 'board' is already assigned
a value or not */

bool non_empty(int row,int col)
{
//0 is default value

if(board[row][col]==0)

return true;

// true indicates unassigned element

else return false;

// false indicates an element which is already assigned a value

}


// a class handiling all the inintialisation part of the board
class initialisation
{
private:
int num,i,j,row,col;
bool flag=true;

public:
void _initialisation();
void display();
};


void initialisation::_initialisation()
{
// in the for loop below ,numbers from 1 to 9 are assigned to the array board[][]

//the row and column index are chosen at random
for(num=1;num<=9;num++)
{
flag=true;

for(i=0;i<9;i++)
{
do
{
row=randrange(0,9);
col=randrange(0,9);

/* in this if statement we perform calls to two functions
non_empty(row,col) returns true only if that element in the
array board is not assigned a value earlier,if not returns false.
check(num,row,col) returns true only if that particular number 'num' is not
repeated in that row and column */

if(non_empty(row,col)&&(check(num,row,col)==true))
{
flag=true;
board[row][col]=num;
}
else
flag=false;
} while(flag==false);

}
}
}




//this method displays the elements in array board[][]

void initialisation::display()
{

for(i=0;i<9;i++)
{
for(j=0;j<9;j++)
cout<
AnswerRe: i'm tring to initialise a sudoku board (9*9) using c++.getting a blank screen with blinking cursor as output. Pin
jeron112-Aug-13 6:53
jeron112-Aug-13 6:53 
GeneralRe: i'm tring to initialise a sudoku board (9*9) using c++.getting a blank screen with blinking cursor as output. Pin
Sierra Technical12-Aug-13 7:54
Sierra Technical12-Aug-13 7:54 
QuestionRe: i'm tring to initialise a sudoku board (9*9) using c++.getting a blank screen with blinking cursor as output. Pin
David Crow12-Aug-13 8:00
David Crow12-Aug-13 8:00 
AnswerRe: i'm tring to initialise a sudoku board (9*9) using c++.getting a blank screen with blinking cursor as output. Pin
CPallini12-Aug-13 23:10
mveCPallini12-Aug-13 23:10 
QuestionName of this DesignPattern Pin
AmbiguousName12-Aug-13 1:43
AmbiguousName12-Aug-13 1:43 
AnswerRe: Name of this DesignPattern Pin
Richard MacCutchan12-Aug-13 5:27
mveRichard MacCutchan12-Aug-13 5:27 
AnswerRe: Name of this DesignPattern Pin
pasztorpisti12-Aug-13 6:29
pasztorpisti12-Aug-13 6:29 
AnswerRe: Name of this DesignPattern Pin
jschell12-Aug-13 8:08
jschell12-Aug-13 8:08 
QuestionQT C1128: number of sections exceeded object file format limit : compile with /bigobj Pin
onur dalkilic11-Aug-13 22:13
onur dalkilic11-Aug-13 22:13 
AnswerRe: QT C1128: number of sections exceeded object file format limit : compile with /bigobj Pin
«_Superman_»11-Aug-13 22:31
professional«_Superman_»11-Aug-13 22:31 
AnswerRe: QT C1128: number of sections exceeded object file format limit : compile with /bigobj Pin
Stephen Hewitt12-Aug-13 16:15
Stephen Hewitt12-Aug-13 16:15 
Questionusing scardAPI how to get DeviceInstanceId Pin
xiliang_pan11-Aug-13 3:40
xiliang_pan11-Aug-13 3:40 
QuestionHow to use an event object for synchronization.? Pin
mbatra319-Aug-13 23:42
mbatra319-Aug-13 23:42 
AnswerRe: How to use an event object for synchronization.? Pin
Richard Andrew x6410-Aug-13 5:39
professionalRichard Andrew x6410-Aug-13 5:39 
AnswerRe: How to use an event object for synchronization.? Pin
pasztorpisti10-Aug-13 10:13
pasztorpisti10-Aug-13 10:13 
GeneralRe: How to use an event object for synchronization.? Pin
mbatra3111-Aug-13 21:18
mbatra3111-Aug-13 21:18 
GeneralRe: How to use an event object for synchronization.? Pin
pasztorpisti12-Aug-13 5:42
pasztorpisti12-Aug-13 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.