10 More Discussions You Might Find Interesting
1. Programming
Hello, I am trying to reverse complement one string and reverse another (NO complement!), both with pointer. My code compiled without error, but did not do the job I wanted.
#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
#include "kseq.h"
// STEP 1: declare the type of file... (5 Replies)
Discussion started by: yifangt
5 Replies
2. Programming
I have a problem with scanf() for string pointer as member of a struct.
#include <stdio.h>
#include <stdlib.h>
struct Student {
int studentNumber;
int phoneNumber;
char *studentName; //line 7
// char studentName; //line 8
};
int... (10 Replies)
Discussion started by: yifangt
10 Replies
3. Programming
I'm newbie learner. My all friend use windows just only me use linux.
so i can't solve any problem by myself. i need a solution.
how can i use pointer as a string.
#include<string.h>
#include<stdio.h>
int main()
{
char *s='\0';
gets(s);
puts(s);
return 0;
}
This code work on... (6 Replies)
Discussion started by: raihan004
6 Replies
4. Programming
Does anyone know?
int x = 1;
int *p = &++x; //ok !
int *q = &x++; //gives an error :O
why the first pointer is ok but the second is an error? (13 Replies)
Discussion started by: nishrestha
13 Replies
5. Programming
I am trying to test some operations on a directed list. However, the declaration of a pointer is giving me trouble.
I seem to have done something incorrectly because I get an error:
"listtest.c:29: warning: 'p' may be used uninitialized in this function"
Can anyone help?
This is my code... (6 Replies)
Discussion started by: bluetxxth
6 Replies
6. UNIX for Dummies Questions & Answers
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
7. Programming
hello all,
my question is not about How code can be rewritten, i just wanna know even though i am not using read only memory of C (i have declared str) why this function gives me segfault :wall:and the other code executes comfortably though both code uses same pointer arithmetic.
... (4 Replies)
Discussion started by: zius_oram
4 Replies
8. Programming
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
9. Programming
could any one tell why the following is showing segmentation fault while using **ptr
but working fine using **a
#include<stdio.h>
... (1 Reply)
Discussion started by: useless79
1 Replies
10. Programming
i have a function:
char *pcCityIdToCountryName(ADMIN_DB_DATA *pstHEader, unit uiCityID)
this returns a pointer to CountryName if cityId is given.
to retrieve countryname i give:
char *CountryName;
CountryName = pcCityIdToCountryName(..................);
but when i compile it is giving :... (5 Replies)
Discussion started by: jazz
5 Replies