70 Posted Topics

Member Avatar for trishtren

#include <stdlib.h> #include <stdio.h> int main() { int iToHex = 2346; printf("%x",iToHex); return 0; } outputs 92a or if you wish you can sprintf it somewhere or use unsigned char for value < 255 #include <stdlib.h> #include <stdio.h> #include <string.h> int main() { int iToHex = 255; unsigned char pcBuffer[sizeof(iToHex)] …

Member Avatar for WaltP
0
389
Member Avatar for tuputavieja

what do you know ? if you know that it is delimited with space before then read it from end of file till space or read some size and parse and then atoi look Maximum value for a variable of type int. 2147483647 for example i could fseek to end …

Member Avatar for Sokurenko
0
121
Member Avatar for reyesg

something like that could be design m? #include "stdio.h" #include "stdlib.h" #define APLPABET_LEN 2//should be 25 struct stAlpha { int iCount; char cChar; }; enum { CHAR_A = 0, CHAR_B = 1,//add needed indexes }; void vPrintResultAlpha(stAlpha stAlphabet[]) { int i = 0; for (i; i < APLPABET_LEN; i++) { …

Member Avatar for WaltP
0
109
Member Avatar for awesomeriley

comment out lines with errors, then slowly uncomment and look for errors next time you write something, compile it every time you add something new while you are learning

Member Avatar for deceptikon
0
183
Member Avatar for robgeek

[this is the link on howto do it](http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/) try to compile hello world program first maybe error is in your code ? cause char* ItemType; is pointer to memmory did you allocate some memmory for it ? and you read to char lineRead; which is actually one byte long, you …

Member Avatar for WaltP
0
355
Member Avatar for Anark10n

try this ? just check everywhere for NULL where possible :) row = mysql_fetch_row(result) while (row != NULL) { for(i = 0; i < num_fields; i++) { //printf("%s ", row != NULL ? row[i] : "NULL"); printf("%s", row[i]); } printf("\n"); row = mysql_fetch_row(result) }

Member Avatar for Anark10n
0
151
Member Avatar for ManT

same as for static, you use array index to access elements [Click Here For Malloc this is dynamic array](http://www.cplusplus.com/reference/clibrary/cstdlib/malloc/)

Member Avatar for Sokurenko
0
30
Member Avatar for nee_88

#include <stdio.h> #include <stdlib.h> #include <string.h> #define HOW_MANY_CHARS 2 int main() { char *s = NULL;//does not point to allocated memmory s = (char*) malloc (sizeof(char) * HOW_MANY_CHARS);//create nice old string memset(s, 0, HOW_MANY_CHARS);//initialize it to zeroes gets(s);//though better to use getchar and check for overflow printf("[%s]\n",s);// print whole c …

Member Avatar for Sokurenko
0
121
Member Avatar for dev90

wouldnt the first one be O(n) or more precise O(n + 66) ? second dont know it's just math something line n * 16 can exyst

Member Avatar for Sokurenko
0
298
Member Avatar for DarkMonarch
Member Avatar for SalicBlu3

malloc new bigger size, copy all data there :) free old memmory and make old pointer to point to new memmory i think this is the concept

Member Avatar for m4ster_r0shi
0
134
Member Avatar for Perry31

this one ? [cplusplus.com/reference/clibrary/cstdarg/va_arg/](http://www.cplusplus.com/reference/clibrary/cstdarg/va_arg/)

Member Avatar for Sokurenko
0
64
Member Avatar for rover100

if(answerInput[count][i]=='.') { printf("ERROR"); break; } or something like that is possible bot i didnt tested just a sketch //read char c = getchar(); while(c!='.' && i<SIZE) { answerInput[count][i++] = c; c = getchar();// get next char then } answerInput[count][--i]='\0';

Member Avatar for rover100
0
166
Member Avatar for Vish0203

http://www.daniweb.com/software-development/c/threads/198632/how-to-compile-and-link-two-c-files-

Member Avatar for Sky_Flyer
0
194
Member Avatar for prasanna123

+1 for undefined, cause printf in your project library maybe written differently or that can be compiler specific no ? anyway why would someone write like that and care about it?? :))

Member Avatar for Sokurenko
0
191
Member Avatar for dannyfang

maybe this ? please review void vRemoveDelimiters(char *pcBuffer, char* pcDelimiters) { int j = 0; int i = 0; int iLen = strlen(pcBuffer); for(i = 0 ; i < iLen; i++) { if( strchr(pcDelimiters, pcBuffer[i]) != NULL ) { j = i; if(strchr(pcDelimiters, pcBuffer[j + 1]) != NULL)//next is delimiter, …

Member Avatar for Sokurenko
0
664
Member Avatar for Mojtabarahimi
Member Avatar for Dean_williams

dont use printf(buffer); to debug memset(buffer,0,sizeof(buffer); //fill it with data for (i=0;i<sizeof(buffer);i++)//print every element { printf("[%c]",buffer[i]);//or printf("[%d]",buffer[i]); }

Member Avatar for Dean_williams
0
216
Member Avatar for cossay

use array index and no need to return nothing, just print name afterwards :) by the way you are not modifying char* and returning from a function, you are modifying the data that pointer points to and returning pointer to that data

Member Avatar for Banfa
0
140
Member Avatar for Vish0203

please comment your code next time, or explain it to your cat hope this helps :) void del() { XY: char del_c[30]; printf("Enter the name of city to be deleted: "); scanf("%s",del_c); struct city *tmp,*prev; tmp = head; if(strcmp(del_c, head->c) == 0)//if data that head points to matches or just …

Member Avatar for Sokurenko
0
288

The End.