Sponsored Content
Top Forums Programming `strcat' makes pointer from integer without a cast Post 302262578 by steephen on Friday 28th of November 2008 03:51:39 AM
Old 11-28-2008
#include <string.h>
int main()
{
char *seq1 = "eeeeeeeeeeeeeeeeee";
char *seq2 = "dddddddddddddddddddd";
const char* a = "*";

seq2=(char*)malloc(strlen(seq2)+1);
strcat(seq2,a);
printf("%s",seq2);

return 0;
}

Is it what you are looking for?
 

10 More Discussions You Might Find Interesting

1. Programming

Will we get SEGV if we try to “delete []” un-initialized integer pointer variable.

I have a class with an integer pointer, which I have not initialized to NULL in the constructor. For example: class myclass { private: char * name; int *site; } myclass:: myclass(....) : name(NULL) { ..... } other member function “delete “ the variable before... (2 Replies)
Discussion started by: sureshreddi_ps
2 Replies

2. Programming

comparison between pointer and integer

I received a warning when I tried to compile my program that said: warning: comparison between pointer and integer Could you please explain to me what this means, and in what ways I could possibly fix this? Thanks for your help! (2 Replies)
Discussion started by: sjung10
2 Replies

3. Programming

strcat() dumping core

strcat dumping core in the situation like main() { char* item; char* p=sat_item; char type; item=(char*) malloc(strlen(p)); strncpy(type,p,4); type='\0'; strcat(item,type); //dumping core } I couldn't get why strcat dumping core? (3 Replies)
Discussion started by: satish@123
3 Replies

4. Shell Programming and Scripting

strcat equivalent in shell scripting

Hi all, How does string concatenation work in shell scripting? I basically have a variable called "string" and I want to add the strings "aaa" "bbb" "ccc" "ddd" to the variable "string". These strings would be added based on some conditions and separated by spaces . So "string" might look... (8 Replies)
Discussion started by: felixmat1
8 Replies

5. Programming

pass a pointer-to-pointer, or return a pointer?

If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it: (1) one is to pass a pointer-to-pointer parameter, like: int my_malloc(int size, char **pmem) { *pmem=(char *)malloc(size); if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 Replies

6. Programming

warning: passing arg 1 of `inet_addr' makes pointer from integer without a cast

I use solaris10,following is tcp client code: #include "cliserv.h" int main(int argc,char argv){ struct sockaddr_in serv; char request,reply; int sockfd,n; if(argc!=2) err_quit("usage: tcpclient <IP address of server>"); if((sockfd=socket(PF_INET,SOCK_STREAM,0))<0) ... (1 Reply)
Discussion started by: konvalo
1 Replies

7. Programming

strcat outputs garbage

Anyone have any ideas why when using strcat function I would get some garbage at the beginning of the output string? what I'm doing is something like the following example. Code: char temp; char tempHolder; for(int i=0;i<something;i++){ sprintf(temp,"%u ", someVariable);... (2 Replies)
Discussion started by: airon23bball
2 Replies

8. Programming

warning: comparison between pointer and integer

Hi guys :D I am still playing with my C handbook and yes, as you can see I have small problem as always :cool: I wrote a C code #include <stdio.h> #define MESSAGE 100 int main(void) { char input_mes - Pastebin.com And when I try to compile it I get following errors from gcc ... (1 Reply)
Discussion started by: solaris_user
1 Replies

9. UNIX for Dummies Questions & Answers

Counting vowels in string. "Comparison pointer-integer".

I'm trying to write a programme which scans strings to find how many vowels they contain. I get an error saying that I'm trying to compare a pointer and an integer inif(*v == scanme){. How can I overcome this ? Also, the programme seems to scan only the first word of a string e.g.: if I type "abc... (1 Reply)
Discussion started by: fakuse
1 Replies

10. Programming

strcat in C

Hello, #include <stdio.h> #include <string.h> void main() { char tab={"12"}; FILE *outfile; char *outname = "/home/dir/"; printf("%s",strcat(outname,tab)); outfile = fopen(strcat(outname,tab), "w"); if (!outfile) { printf("There was a problem opening %s for writing\n", outname); ... (2 Replies)
Discussion started by: chercheur857
2 Replies
Bio::ClusterI(3pm)					User Contributed Perl Documentation					Bio::ClusterI(3pm)

NAME
Bio::ClusterI - Cluster Interface SYNOPSIS
# see the implementations of this interface for details my $cluster= $cluster->new(-description=>"POLYUBIQUITIN", -members =>[$seq1,$seq2]); my @members = $cluster->get_members(); my @sub_members = $cluster->get_members(-species=>"homo sapiens"); DESCRIPTION
This interface is the basic structure for a cluster of bioperl objects. In this case it is up to the implementer to check arguments and initialize whatever new object the implementing class is designed for. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Shawn Hoon Email shawnh@fugu-sg.org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ Implementation Specific Functions These functions are the ones that a specific implementation must define. new We don't mandate but encourage implementors to support at least the following named parameters upon object initialization. Argument Description -------- ----------- -display_id the display ID or name for the cluster -description the consensus description or name of the cluster -members the array of objects belonging to the family display_id Title : display_id Usage : Function: Get the display name or identifier for the cluster Returns : a string Args : description Title : description Usage : Bio::ClusterI->description("POLYUBIQUITIN") Function: get/set for the consensus description of the cluster Returns : the description string Args : Optional the description string size Title : size Usage : Bio::ClusterI->size(); Function: get/set for the size of the family, calculated from the number of members Returns : the size of the family Args : cluster_score Title : cluster_score Usage : $cluster ->cluster_score(100); Function: get/set for cluster_score which represent the score in which the clustering algorithm assigns to this cluster. Returns : a number get_members Title : get_members Usage : Bio::ClusterI->get_members(($seq1, $seq2)); Function: retrieve the members of the family by some criteria, for example : $cluster->get_members(-species => 'homo sapiens'); Will return all members if no criteria are provided. Returns : the array of members Args : perl v5.14.2 2012-03-02 Bio::ClusterI(3pm)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy