- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
student
- Interests
- IT,football,foreign languages,music
36 Posted Topics
Re: I need a good book about Data structures(linked lists,stacks,queues,trees, all the menu) in C So far i tried O'Reilly --Mastering Algorithms with C , but i'm not very content with the code examples. If you've read one , and you think it's a good book, pls post the name and … | |
Re: I had the same assignement 1 month ago ;) Here's the code : [code] #include <stdio.h> #include <string.h> #define SIZE 100 int count(char vector[],int nr); int main() { int i,string_size,x; char string[SIZE]; printf("Type a text: "); gets(string); string_size=strlen(string); x=count(string,string_size); printf("Number of words: %d\n",x); return 0; } int count (char vector[],int … | |
Re: U forgot to put the ampersand at age.It should look like this [code]scanf("%d",&age)[/code] btw,u might wanna declare variable age first. | |
Re: U can use the array_search() function [URL]http://www.php.net/array_search[/URL] Make sure u use the "===" for comparising. It should look something like this : [code] if ($NewVersionFlag==0) { $i=0; foreach($array1 as $value) { if( array_search($value,$array2) !== 0 ) ++$i; } if( $i == count($array2) ) echo 'The two arrays have the same … | |
I have one or more functions separate from main() , that besides the return value , must also return the time it tooked to process. How can I do that ? | |
Hi guys , In Visual Studio 2005 I compiled the following code [CODE] int main() { float a; a=0.1; if(a<0.1) { printf("C\n"); } else { printf("C++\n"); } } [/CODE] I was very surprised when I saw the output C++ . I got the warning C4305 :" '=' : truncation from … | |
Re: I assume you have a single form , with lots of input of type checkbox. In this case , what you can do to avoid the if/else avalanche is to loop through the $_POST array , and make a single if statement. For this to work , you must give … | |
Hey guys , While playing with jquery i've come across the following situation : [code] $(document).ready(function(){ $("div")[0].css("background-color","blue"); }); [/code] I get an error everytime i try to call any method on a particular element from the wrapper set . I tried with the get() [code] $("div").get(0); [/code] Same stuff . … | |
Re: To AncientDragon : the a[num],v[num]... doesn't work,because num is the same in that insant moment(i tried that). To Little E :1.Offtopic: next time try to type the code between code.../code tags ;) 2.What you need is this : [code]#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { const char *a[5] … | |
Re: This code gets the today's gas price It's easy to get it on this site because the price is placed between a span with the id "GBPS_lblUSToday" [code] $arr = file("http://www.gasbuddy.com/"); $gasprice = ""; foreach ($arr as $key => $line) { if (strstr($line, "GBPS_lblUSToday")) { $gasprice=$line; break; } } echo … | |
How can I have a post quick reply textarea , just like the one on daniweb , in a phpbb 2.0 ? Do you know/have a mod that does that ? | |
Re: in the $header,make sure you have a space after From: [code] $headers="From: Mycompany asdfa@asfa.com"; [/code] | |
Re: If the user input is ,for example [B]"house[/B] [B]Seattle job"[/B] and you wanna get the Seattle word, you can do this with explode [URL]http://www.php.net/manual/en/function.explode.php[/URL] [code] php if($_GET['KEY'] == "") { // no keyword entered echo ""; } else { $userCity=array(); $userCity=explode(" ",$_GET['key']); [/code] Now you must loop through the userCity … | |
Re: Are you sure you don't have a closing php tag( ?> ) somewhere ? Type phpinfo(); at the line where it crashes ,to see if the interpreter works at that point( although I'm pretty sure it won't) | |
Re: [quote=nil_gh_80;424695]Dear members, can any body plz help me out to insert image file in MySQL.......is it possible ???????? [/quote] Dude , have you read at least one php book ???? Inserting images in MySql it's possible by using a BLOB column , but is [B]very very [/B] [B]inefficient [/B] It … | |
Re: [quote=Firestone;421312]I'm trying to mail a newsletter to a list of people, but I get an error every time it tries to mail. Anyone know what I'm doing wrong? [code=php] <?php $file = fopen("upload/newletter.html", "r"); $sub = fopen("to.txt", "r"); $x = 0; $y = 0; while (!feof($sub)) { $names[$x] = fgets($sub); … | |
Re: [quote=namorim;419512]Hi guys, Please, I need your help. I made a web site with a login page. In my laptop it works perfectly, bu when I move the site to other computer, and I put the user name, the password and submit it doesn´t move to the next page. I´m using … | |
I have a list of users(signed for a newsletter).I'm retrieving the list from a database when the admin clicks on a button. [B]There are maximum 10 users diplayed per page[/B].For example,if I had 30 users in the database,I would have 3 pages of users(Page 1,2,3); [B]For each listed user ,I … | |
Re: This is a very famous error in php . If you echo something , before the header function you'll get an error because the "channel" was occupied by echo.You need to put the header before any echo's or you can go in php.ini and set the output_buffering=On ( it's Off … | |
Re: First of all , you must get the hole html content of the page in an array.U can do that with the file() function an example : [code] $arr=file('http://www.yahoo.com'); [/code] Grabs all the content found on yahoo.com. Next you must reach to the area which you want.Use a for loop … | |
Re: [quote=seagram;412654] [code] if($valid_user=1) echo "You are logged in"; [/code] [/quote] if($valid_user[B]==[/B]1) :P ![]() | |
Re: [quote=Lomas;401130]azimuth0... :) Thank you very much..... its working now... i just found out if u turn on the "register global" setting for php5 ... the old codes will work as well.... again.... thanks.... really appreciate your help...[/quote] It's better if you leave it off . Imagine how easy is for … | |
I'm looking for a C++ book with exercices(solved),practice or something like "tips and trips of c++ language" cause I need to prepare for the exam. If someone know's a kind of this book , pls reply.I searched google , but didnt found what i want | |
The following cod,when I press the [I]SUBMIT[/I] button , I get [I]"[COLOR=Red][COLOR=Black][B]Forbidden[/B][/COLOR], You don't have permission to access /< on this server[/COLOR]." [/I][code] <html> <head> <title> The Internet Joke Database </title> </head> <body> <?php if (isset($_GET['addjoke'])): // If the user wants to add a joke ?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <p>Type … | |
I have a class , named Set,and I want to overload the operator - so I can get the difference between 2 Set object. [COLOR=Blue]i.e. A={1,2,3,4} , B={ 3,4,5,6} , A-B={1,2} [/COLOR] In header file I declared the operator function like this : [code] Set operator-(const Set & ) ; … ![]() | |
I have 2 desktops ,with 3 network cards and Win XP.I want to connect them so i can share my files and internet connection,only that I'm getting "[COLOR=Red]A network cable is unplugged". [COLOR=Black] I did everything : make crossover cables,run the network wizard , u name it ... but still … | |
[URL="http://img218.imageshack.us/my.php?image=sketchmh1.gif"][URL=http://img513.imageshack.us/my.php?image=sketchlw8.gif][IMG]http://img513.imageshack.us/img513/8739/sketchlw8.th.gif[/IMG][/URL][/URL] I have something like this : The reallocation of a piece of memory that works like a circular queues I've made a sketch explaining this ,I hope , very clearly I just need a clue,a tip,something that will get me started , because right now I'm stucked Thx | |
Re: Or maybe what u need for is this : [url]http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/LectureNotes/index.htm[/url] Now,it's not a book ,but it's very helpfull | |
Re: I had almost the same problem 2 weeks ago ,but i've done it in c (we aren't learning c++ until next semester) The ideea is the same ,try to convert it in c++ [code] /* Autor:Matei Dragos Grupa:133 Problema:No1 din lab6.pdf Enunt:Plecand de la o generatie de virusi data, sa … | |
Re: [code] #include <stdio.h> #include <ctype.h> #include <string.h> void uppercase(char []); int main() { char text[255] ; printf(" Enter String: "); fgets( text, 255, stdin ); uppercase(text); return 0; } void uppercase(char text[]) { int i, first = 1; for ( i = 0; text[i] != '\0'; ++i ) { if … | |
Since programming has a lot in comun with math,I sugest to have a special topic for that , so that people don't have to go on other forums when they want to find out ,for example,the gauss method of solving matrices ,useful in creating a program that outputs the determinant … | |
Re: For those who want to understand the asymptotic notation, try this link:[url]http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/LectureNotes/index.htm[/url] It's a very good site with video lectures from m.i.t.(the asymptotic notation is in the second lecture) Good luck | |
Re: After 30 min of thinking , I came up with this: [code] #include <fstream> #include <iostream> using namespace std; int main() { int i,poz=0; int a[100]={0}; fstream f("c:\\graf.txt",ios::in); while(f>>i) a[poz++]=i; for(i=0;i<poz;i++) cout<<a[i]<<" "; cout<<endl; return 0; } [/code] I dont have much experince with fstream functions...but i hope this will … | |
Re: Here's a complete tutorial , made by me :cheesy: 1.First try to get Visual C++ Express Edition ,it's free You can get it at [URL]http://msdn.microsoft.com/vstudio/express/visualc/[/URL] 2.After install,run the program .You will get the start page [URL="http://img91.imageshack.us/my.php?image=startpageuy3.gif"][IMG]http://img91.imageshack.us/img91/6809/startpageuy3.th.gif[/IMG][/URL] Create->Project 3.Go to Win32 Tab , and name your project [URL="http://img156.imageshack.us/my.php?image=createql9.gif"][IMG]http://img156.imageshack.us/img156/2061/createql9.th.gif[/IMG][/URL] 4.Select win32 console … | |
Re: Oki,i dind't really understand what u are trying to do , but here is what i 've come with: [code] #include <iostream> using namespace std; int max(int vector[],int size); int main() { int *p=NULL; int n,i; cout<<"Array size :"; cin>>n; p=new int[n]; for(i=0;i<n;i++) { cout<<"p["<<i<<"]= "; cin>>p[i]; } cout<<"The maximum … | |
I'm learning linked lists , and in my manual i have the following example. [code=c] #include <iostream> using std::cout; using std::cin; using std::endl; struct element { int info; element *address; }; void insertion(element *&p,int nr) { element *c; c=new element; c->info=nr; c->address=p; p=c; } void print(element *p) { while(p!=0) { … |
The End.