Dev-c++ 4.9.9.2
windows xp
Type: Posts; User: zcrself
Dev-c++ 4.9.9.2
windows xp
bool cmp1(string a, string b)
{
return a.length() <= b.length() && a < b;
}
int main()
{
std::vector<string> vec;
vec.push_back("ab"); vec.push_back("b"); vec.push_back("aaa");
...
thanks for your suggestion!
I do appreciate your suggestion, thanks a lot
bool cmp1(string a, string b)
{
if(a.length()==b.length())
{
return a < b;
}else
aa aaa adfd dd
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main()
{
std::vector<string> vec;
vec.push_back("dd"); vec.push_back("adfd");...
Thanks a lot for a lot of senior programmers answering my questions eagerly.
I learn C further for a newbie of C
Thanks for your answer so that I understand C more clearly.
java language has try-catch function,
what does C language has?
Can "try-catch" function handle the error "segmentation fault"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
typedef QUALITY int;
#define PAIRENDLEN 2000
void getSSnumber(char *input,QUALITY *snpCount)
{
//char buff[BUFSIZ];
...
Sometimes, when my program runs, there is a error "segmentation error", but I don't know why and where is the error. I want to handle this error, but I don't know how to do handling.
Do you...
I like this answer. It is better
#include <stdio.h>
#include <stdlib.h>
char* fillData()
{
char *fd = (char*) malloc ( 100*sizeof(char));
for ( int i = 0; i < 100; ++i )
{
fd[i] = 'A';...
thanks for your answer. It is good for me.
I see!
my means is that how to test one data structure whether be defined.( how to test the data which will be printed whether is out of memory )
char *string = (char*) malloc (...
It's my mistake for starting multiple threads for the same question!
I write some codes as follows:
int main()
{
int a[2];
a[0] = 1;
a[1] = 1;
return 0;
I write some codes as follows:
int main()
{
int a[2];
a[0] = 1;
a[1] = 1;
return 0;
typedef short int usint;
/* malloc memory m line n column*/
usint** ctArray(const int m,const int n)
{
usint** ptr;
//usint* tmp;
if( (ptr = (usint**) calloc (m,sizeof(usint*))) == NULL )...
Yes. 64 bit type here
line 51: fpHASH=fopen(argv[1],"w");
gdb log
[s@node6 ~]$ gcc -g -o patch patch.c
[s@node6 ~]$ gdb patch
GNU gdb Red Hat Linux (6.3.0.0-1.153.el4rh)
#include <stdio.h>
#include <stdlib.h>
#define B64_long long
B64_long **limatrix(B64_long nrl,B64_long nrh,B64_long ncl,B64_long nch)
{
B64_long i,...
I can't understand your answer clearly
program:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int getLineCount(char *input)
{
FILE *fp;int i = 0; char buf[100];
Yes.
while( fgets(buf,100,fp) != NULL )
{
//char *x = fgets(buf,100,fp);
i++;
printf("%s\n",buf);
//fputs(buf, fp);
}
...