Thx for the clarification. The following works now
#include <stdio.h>
int main(void)
{
// you need malloc otherwise memory error.
char* string=(char*)malloc(5);
Type: Posts; User: gunitinug
Thx for the clarification. The following works now
#include <stdio.h>
int main(void)
{
// you need malloc otherwise memory error.
char* string=(char*)malloc(5);
This works.
#include <stdio.h>
int main(void)
{
// you need malloc otherwise memory error.
char* string=(char*)malloc(5);
#include <stdio.h>
int main(void)
{
// you need malloc otherwise memory error.
char* string=(char*)malloc(5);
set(string);
printf("%s",string);
return 0;
}
#include <iostream>
using namespace std;
int HighestTemp(int**, const int, const int);
int HighestTemp(int** temp, const int row, const int col) {
int highest = 0;
for (int i=0; i<row;...
THank you
#include <iostream>
using namespace std;
const int MAX=100;
int elems[MAX]={1,2,3};
int card=3;
void Rem(const int e);
void Rem(const int e) {
THX elysia
std::string const & user::nickname() const
{
return m_data->nickname;
}
Here what is the meaning of & used? THanks.
Thanks man. Don't call me wacko though. I was trying to create a tree like structure.
Fixing that small error it prints 123.
/*
* treeattempt1.h
*
* Created on: 21/06/2012
/*
* treeattempt1.c
*
* Created on: 21/06/2012
* Author: logan
*/
#include <stdio.h>
struct node {
I did coding on galaxy tab. woot
Ok i'll look into it :o
Say you are in chat room and in it there are 3 users.
paul127, mary532, mark456
You type pau and press tab to automatically complete paul's user name. The following code prototypes that feature.
...
Thanks. I had to reset i and j to their original values inside while loop. Here's code returning "app" as expected after matching.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>...
#include<stdio.h>
#include <string.h>
#include <stdlib.h>
const char* search1="";
const char* search2="apple";
const char* search3="apple tree";
char* strings1[3]={"","",""};
char*...
Thanks tc. I've tried your code.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
char buf[3][10]={"pine", "apple"};
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main() {
char buf[3][10]={"apple", "pineapple", "banana"};
char** ptr=(char**)buf;
puts(*ptr);
}
ok thanks ;)
Output gives blank line instead of "hello".
#include <stdio.h>
#include <string.h>
char* test(char* s) {
char ret[]="";
strcpy(ret, s);
return ret;
}
int main() {
free(ptr[1]);
This gives me either memory dump or seg fault. How to free ptr, ptr[0] and ptr[1] safely?
OK memory leaked so it can't free it.
This works.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
char string[]="apple";
char** ptr=(char**)malloc(2*sizeof(char*));
ptr[1]=(char*)malloc(10*sizeof(char));
...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
char** ptr=(char**)malloc(2*sizeof(char*));
ptr[0]=(char*)malloc(10*sizeof(char));
...
oh yeah i forgot to put malloc in line 26
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
int value;
char* value2;
} demo;
void test(int* v) {