Yes sir/madam... I'll try my best to remember this note.
Palm.
User Profile
Collapse
-
Hi weaknessforcats ,
Thankx a lot for you great help... It seems I didn't have most fundamental stffs in C.. thankz again for your hel.. It works perfect.
palm.Leave a comment:
-
Thanks a lot weaknessforcats ,
Thanks for pointing out my mistakes and explaining very clearly. I've corrected my code as you explained and it's working fine, except it's printing a garbage character infront of the string and deleted last 6 characters, but when i just put a printf statement before the initalization of arrays finall and what, it's printing fine. What's going on with this string?
#include <stdio.h>...Leave a comment:
-
Hi Jos,
Thanks for your help. I tried your method, but it's not giving proper out put though. It's working without any error and just saves % signs into out. Any other idea? Logic behind my while loop seems fine and it's going inside the loop 4 the correct number of time, but not saving all the characters in to my variable to out put....
Palm.Leave a comment:
-
-
The code is working partially correct. I'm supposed to get this out put:
%61%73%61%66%64 %28%61%64%66%61 %64%29%2f%5b%79 %65%73%20%3f%5d
but I'm getting this out put:
%61%735d5d
which just prints first two % signs and the numbers properly and then last number twice for some reason. I'm totally confused... Could some one plz help me to get correct out put? This is my code:
#include...Leave a comment:
-
yes, i need to save first char to another array and first int to next element of that array then second char and then second int and so on....
i tried to create a string with "%" sign following int and then "%" sign and then int using sprintf and strcat like this:
while (x[i] != '\0'){
sprintf (cha,"%s","%%") ;
strcat (new,cha);
sprintf...Leave a comment:
-
Hi Arne,
Thanks for your quick response, but unfortunately sprintf doesn't seem working. It's saving my int value, but not the character "%". When I tried to save "%%", it's just saving blank space, not the % sign. This is what I tried:
char *final="";
sprintf(final," %%","%i", x[0]);
if i just say sprintf(final," %i",x[0]),...Leave a comment:
-
String in C
Hi Guyz,
Does anyone know how to make a string (in C program) out of different types of variables? I have an int array called x and a string array called y. I need to make a string in the form of :
y[0]x[0]y[1]x[1]..... (Eg: a1u3b2%3#8...)
I tried to use strcat, but it's giving error saying my y array is int and it has to be char. Can some one help me plz... Does any one know how to create... -
Hi there,
I just wanted to share what I've found... This seems working fine:
#include <stdio.h>
#include <string.h>
void main(){
char a[]= "apple)ljdf d&";
int y=0;
for (int i=0; i< sizeof (a)-1; i++)
{
y= ("%x",a[i]);
printf ("%%");
printf ("%x",y);
}
...Leave a comment:
-
ASCII encoding
Hi There,
I need to encode some strings in C program before I pass them to url. Can some one help me please?
Palm. -
Thanks a lot KevinADC,
You've solved my problem. I thought when I read the lines, the "\n" can be read too, but it didn't work that way.
Thanks again.
Palm.Leave a comment:
-
Read New Line and print in HTML
Hi There,
I've a Perl code that reads a txt file (which has colum data) line by line, but for some reason when I print it in html, it's not printing as colum data. Instead it's printing in one line. This is my Perl code that reads the lines:
while (<FILE>){
$line = $line . $_ ;
}
and this is my html part:
<br> $line <br>
I'm new to both languages... -
Hi There,
I'm new to Perl and I just wrote few lines to do an http request. The code is working fine and I'm trying to save the variables (param('age')). They just show up inside the html page, but not as an out put in the screen editor. What do I have to do inorder to get them printed in the editor or save to a file? This is my variable in Perl:
my $age = $cgi->param('age') ;
when I say "print...Leave a comment:
-
Hi There,
I tried to get/print the variables in the http request like this:
use CGI qw/:standard/;
my $cgi = new CGI;
..
..
..
print $cgi->param("total") ;
print $cgi->param("name" );
print $cgi->param("compute r");
but it's not printing anything. I'm totally lost. I'm I missing anythig? Please some one help...Leave a comment:
-
Hi there,
Now both programs are working with out any errors, but I don't see/get the variables (total=789456,n ame='jack',comp uter= 'desktop'). How can I get them in receive.pl? response-> content doesn't seem working.
Palm.Leave a comment:
-
Sorry Miller,
I couldn't find a solution so I thought I better divide the probem into small parts and start a new discussion. I'll continue posting in this old topic then.
Thankz.
Palm.Leave a comment:
-
http request help
Hi There,
I've a perl program called "receive.pl ", which is supposed to get some variables from another program called "send.pl". When I run my receive.pl, I'm getting page not found error message. Since I'm new to programming, it'll be great if any one could help me out. This is how my receive.pl looks like:
...Code:#! /usr/bin/perl use strict;
Leave a comment:
-
Hi Miller,
Thanks a lot for your help. I tried those steps and getting '404 not found' error message. I used those steps in my send.pl and I wrote the following code for receive.pl. I'm not sure where the problem is:
#! /usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTTP::Request:: Common;
use URI;
my $ua = LWP::UserAgent->new;
my $uri = URI->new('http://abcd.com/cgi-bin/receive.pl');...Leave a comment:
-
Hi Kevin & Miller,
I'm a new programer so I'm having little hard time in getting through this. I wrote this code and tried to send the parameters but i'm getting some message like The requested document was not found, etc etc.. This is what I've written:
...Code:#! /usr/bin/perl -w use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST
Leave a comment:
No activity results to display
Show More
Leave a comment: