519 Posted Topics

Member Avatar for hawita

After inputting the data, should you not create a separate for loop from 0.. 360 for that increment stuff ?

Member Avatar for abhimanipal
-3
131
Member Avatar for coding101

@Walt Quick question, the condition in the while loop will use arithmetic and relational operators right ? Or is there any way to write the while loop condition?

Member Avatar for Narue
0
91
Member Avatar for vineeth vs

Also I notice that the loc variable used in while loop in the quick sort is not initialized.

Member Avatar for Narue
0
253
Member Avatar for rockerjhr
Member Avatar for JDevelop
Member Avatar for JDevelop
0
2K
Member Avatar for seanman13579

Quick question, What is the data that you are trying to store in the stack ? 1's or the content b/w the < .... > tags ? If you going to store just 1's then your program will break for [CODE] <html> <a> My text </b> </xml>[/CODE] Storing the content …

Member Avatar for WaltP
0
2K
Member Avatar for math.man

@L7Sqr the pattern is that you alternatively add 1 , then add 2 and so on ... @OP Please provide more info about the problem statement and post your coding efforts

Member Avatar for abhimanipal
0
86
Member Avatar for johann26

This should help you get started for each suite i: 1...4 for each card j:1 ... 13 // Now set the properties for the card

Member Avatar for abhimanipal
0
95
Member Avatar for WolfShield
Member Avatar for rubberman
0
193
Member Avatar for moroccanplaya

@moroccanplaya Gerard is opening the file in r mode while you are opening the file in rb mode. Could this be an issue ?

Member Avatar for abhimanipal
0
175
Member Avatar for hawita
Member Avatar for Vindal

Can you please give an example of the expected Output and the output that you are getting ?

Member Avatar for abhimanipal
0
198
Member Avatar for biancaW

What is your question ? By the way from the code you have posted I suggest you look at a tutorial on the concept of arrays

Member Avatar for abhimanipal
0
197
Member Avatar for subwired

Further clarifying gerard's post uint16_t is a data type ..Kind of like int / char ...

Member Avatar for abhimanipal
0
120
Member Avatar for hawita

1. Take the input from the user into a string called input 2. Use string length to go to the end of the string. 3a. Start iterating towards the start of the string. When you hit the space char, then stop. Store the chars that you iterated over into a …

Member Avatar for abhimanipal
0
201
Member Avatar for abhimanipal

Hi All, First of all let me start by saying I love Daniweb and I try to take time out everyday to answer the questions that are posted in the various forums. But I am often on the move which means I have to follow the chains of messages in …

Member Avatar for abhimanipal
0
122
Member Avatar for shinsengumi

You should first try to write a string matching algorithm . If the longer strings contains the smaller string in many places, can you successfully print the locations of the sub string in the main string ?

Member Avatar for Adak
0
584
Member Avatar for london-G

Also you cannot use variables as case numbers in a switch statement. It has to be to contants Check out [URL="http://www.google.com/search?client=ubuntu&channel=fs&q=c+switch&ie=utf-8&oe=utf-8"]this[/URL] link

Member Avatar for london-G
0
182
Member Avatar for abhimanipal

Hello Everybody, I have a small confusion with regards to pointers. Here is some code [CODE] int main() { int *p1 = (int*)malloc(sizeof(int)); *p1 = 10; printf("The number is %d",*(char*)p1); }[/CODE] I run the code and the O/p is 10. My question is, is there no difference in using char …

Member Avatar for nezachem
0
142
Member Avatar for cyberbemon

Do something of this sort for inducing delay 1. Create a thread to run in the background. Let this thread call function f1() when it wakes up. int flag = 0; int main() { // Create a thread to run in the background. Let this thread call f1() int numberOfThreads …

Member Avatar for Ancient Dragon
0
177
Member Avatar for BlueDevil

Some pseudo code [CODE]while(true) { // Take the I/P from the user // Check if the first row has all X's // Check if the second row has all X's .... ... // CHeck for all rows, all columns, diagonally for X's and 0's }[/CODE]

Member Avatar for abhimanipal
0
97
Member Avatar for uditjindal

Just a thought ... I think this might help you ... When you use a file for storing data you cannot just update a single line of text in that file. You have to read the entire file into memory, make the changes that you want in the memory and …

Member Avatar for abhimanipal
0
145
Member Avatar for rockerjhr
Member Avatar for nadleeh

There are 2 concepts involved here Concept 1: In a Binary Search tree if you print all of the nodes inorder then the output will be an array sorted in ascending order. Extending this to your problem, you can use the last name as an index for inserting data into …

Member Avatar for Narue
0
122
Member Avatar for aditi17

Check [URL="http://www.google.com/search?client=ubuntu&channel=fs&q=c+spiral+matrix&ie=utf-8&oe=utf-8"]this[/URL] out

Member Avatar for prvnkmr194
-1
68
Member Avatar for ImDead

If you dont want to implement your own sorting function then check out [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/"]this[/URL] link. PS I know this link is from a C++ reference, but I think it will work in c code as well. Others please correct me if I am wrong

Member Avatar for abhimanipal
0
160
Member Avatar for charchar88

The error on line 52 is that you cannot use string as a name of a variable ... I think the keyword string is reserved. If you notice it got high lighted when you pasted the code here Also why are you doing an operation inside the print function ?

Member Avatar for abhimanipal
0
209
Member Avatar for hansel13

When you create the consumer thread, check the function call. The last parameter is s . It should be &i

Member Avatar for funter
0
2K
Member Avatar for n3red

Some of the functions you might need strtok --> Use this function to split a string into a series of words strcmp --> Check if this word is a name or a period

Member Avatar for abhimanipal
0
125
Member Avatar for geoffy0404

In the if ... else block you have used the variable total twice. I think you meant to use totalPoints in one of the places ... Also if I am using 2 conditions separated by a logical operator in an if statement trying I write it like this [CODE]if ( …

Member Avatar for abhimanipal
0
220
Member Avatar for rohan_k

@rohan I think, theoretically speaking the approach described by Walt is faster than your approach Walt's Approach Read the entire file to find the size of the file --> O(n) Alloc a buffer of size n and copy the contents of the file in buffer --> O(n) `O(n) + O(n) …

Member Avatar for abhimanipal
0
244
Member Avatar for livingsword

[QUOTE=ankithajain1989;1338019]i want pascal triangle code i am a beginner doing my m.c.a[/QUOTE] If I am not wrong MCA is a post graduate degree right ? If it is indeed a post graduate degree then its high time you started writing your own code

Member Avatar for vipinkumar512
0
745
Member Avatar for srisrisri

String reverse without using additional space 1. Use strlen (or write your own function) to calculate the length of the string 2. x= strlen /2 3. from 0 to x, interchange the positions of the first and last, second and second last .... and so on

Member Avatar for minhajakhter
0
316
Member Avatar for chenlynn

Small hint if you are totally stuck ... Use for loops My personal advise is first try to sum up all the values in an array, then go for higher dimensions

Member Avatar for Lesetja Frederi
0
158
Member Avatar for SpyrosMet

If you want to make your own string comparison function 1. If length of string 1 is not equal to string 2 then, strings are not identical 2. for i:0, to strlen, check if the str1[i] == str2[i]. If they are not equal then break out of the loop

Member Avatar for Agnusmaximus
0
1K
Member Avatar for writt

Is there any max size to the titles ? Is there any way to determine how many titles are going to come in ? Instead of a 2d array how about a linked list of structs ?

Member Avatar for writt
0
263
Member Avatar for ottilie

Quick question were you looking for a mathematical solution or a programming kinda solution like the one described above ?

Member Avatar for apines
0
129
Member Avatar for d00mhammers

I really like "Let us C" by Yashwant Kanetkar This book assumes no previous knowledge of programming and teaches C programming in a very step step and methodical manner

Member Avatar for arnab sinha
0
319
Member Avatar for vishalarora91

What kind of error are you getting ? Did you include all the header files ?

Member Avatar for armadillodesing
0
101
Member Avatar for Agnusmaximus

[URL="http://en.wikipedia.org/wiki/Internet_bot"]This[/URL] gives general information about bots I am not entirely convinced if you need this information for destructive or constructive purposes so I will not give any further information. If you are really interested in this topic then google will be your best friend in this endeavor

Member Avatar for Agnusmaximus
0
237
Member Avatar for hussamat

In your while loop (lines 36 - 39) you are not checking to see if you hit NULL or not WHen you do current = current->next check to see current->next is not equal to NULL

Member Avatar for abhimanipal
0
128
Member Avatar for Teelnaw

This is how I would approach this problem Suppose I have to remove the string "tes" from United States of America 1. Check to see if I can find a t any where in United states of America 2. If do find a t then check for e and then …

Member Avatar for abhimanipal
0
210
Member Avatar for brendono978

Do a google search for "implement my own strstr function" you will find lots of suggestions

Member Avatar for brendono978
0
1K
Member Avatar for bufospro

Check out this piece of code [CODE] int main() { char arr[10]; //Max i/p size is 10 ie 9 letter and \0 char* p = NULL; printf("Enter your name \n"); fgets(arr,10,stdin) ; //stdin is standard input // If the user enters 9 or less chars then the first 10 chars …

Member Avatar for bufospro
0
185
Member Avatar for shante88

Check out [URL="http://www.daniweb.com/forums/thread6713.html"]this[/URL] thread

Member Avatar for abhimanipal
0
107
Member Avatar for manish7286
Member Avatar for cbebop7

Is the format of the input file pre defined or can it change If the input file format is not fixed then this is a hard problem

Member Avatar for cbebop7
0
963
Member Avatar for jemz

Write your accept function this way I have separated the data input and the smallest number calculation into 2 steps but you dont have to [CODE]void accept(int *a) { int size =0,i=0; printf("Enter the size of the array\n"); scanf("%d",&size); a = (int*)malloc(sizeof(int)*size); // Size of the i/p array is dynamic …

Member Avatar for jemz
0
122
Member Avatar for myk45
Member Avatar for Unidennn

If you want to use pointers to pass a 2-D array write your code like this [CODE] void printStuff(int* a,int rows,int cols) { int i=0,j=0; for(i=0;i<rows;i++) { for(j=0;j<cols;j++) printf("%d\t",a[(i*rows) + j]); } } int main(int argc, char *argv[]) { int a[3][3]; int i=0,j=0,count=0; for(i=0;i<3;i++) { for(j=0;j<3;j++) a[i][j] = count++; } …

Member Avatar for abhimanipal
0
125

The End.