No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
6 Posted Topics
My distributed operating system lab requires me to implement the election algorithm (bully and ring) in c. My current idea is to run several instances of an ouput file on different terminal, each symbolizing a different process. Now i'm facing the following problem and if you guys could just point … | |
[code=php] $conn=odbc_connect('mobshopDB','',''); if(!$conn){ exit("Connection Failed: " . $conn); } $query="INSERT INTO users(uid,pass,fname,lname,pmm) VALUES('$username','$password','$fname','$lname',$pmm)"; $rs=odbc_exec($conn,$query); [/code] this query gives me this error Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005 in SQLExecDirect in C:\Program Files\EasyPHP-5.3.6.0\www\mobshop\registered.php on line 39 ..please suggest a … | |
[code=c] void Assembler :: pass2(ifstream &inHandle, ofstream &outHandle) { outHandle<<setfill('0'); while(!inHandle.eof()) { inHandle.getline(src_line,50); //declerative or imperative statement if(toascii(src_line[0])>=48 && toascii(src_line[0])<=57) { breakStatement(); outHandle<<address<<")\t+ "<<mnemonicCode<<" "<<regCode<<" "<<setw(3)<<operand<<"\n"; } else outHandle<<"\n"; } } void Assembler :: breakStatement() { int i=0,j=0; char oprCode[20],oprClass; ifstream in; //initializing all variables strcpy(address,NULL); strcpy(mnemonicClass,NULL); strcpy(mnemonicCode,NULL); init(oprCode); regCode='0'; … | |
this is the code for my class assignment [code=c] import java.util.Calendar; class ClockThread implements Runnable,KeyListner{ int sec,min,hour; Thread thr; ClockThread(){ Calendar rightNow = Calendar.getInstance(); hour=rightNow.get(Calendar.HOUR); min=rightNow.get(Calendar.MINUTE); sec=rightNow.get(Calendar.SECOND); thr=new Thread(this); thr.start(); } public void run(){ while(true){ try{ Thread.sleep(1000); sec++; } catch(InterruptedException ie){ System.out.println(ie); } if(sec>=59){ sec=0; min++; } if(min>=59){ min=0; hour++; … | |
[code=c] int i=0,j=0; char operand[30]; char lbl[20],opr,num[20]; while(i<30) lbl[i]=num[i]=operand[i++]=NULL; cin>>operand; for(i=0; operand[i]!='+' || operand[i]!='-'; i++) lbl[i]=operand[i]; opr=operand[i++]; while(operand[i]!=NULL) num[j++]=operand[i++]; [/code] ..is there any mistake in this piece of code, my execution is getting stuck at [code=c] lbl[i]=operand[i]; [/code] | |
[CODE=c] int main(int argc, char *argv[]) { ifstream inHandle; Assembler obj; if(argc!=2) { cout<<"InvalidInput ERROR"; } else { inHandle.open("test.asm"); if(inHandle==0) cout<<"FileNotFound ERROR"; else obj.pass1(inHandle); } inHandle.close(); return 0; } [/CODE] this is my code for the main() function, i have tried entering the filename in every possible format but the … |
The End.