you can simly compare an int type with a,b,c,d etc.
i.e if(a==6) etc.
again if want an array of size b you can do
type array[b];
Type: Posts; User: mrbains
you can simly compare an int type with a,b,c,d etc.
i.e if(a==6) etc.
again if want an array of size b you can do
type array[b];
Hi iam new to openGL an i want to know how to print vertex using openGL in a 2d plane.
suppose i want to print p(2,5),q(3,2) etc on the 2d plane.
all in know that there is a function for printing...
Hi iam new to openGL an i want to know how to print vertex using openGL in a 2d plane.
suppose i want to print p(2,5),q(3,2) etc on the 2d plane.
all in know that there is a function for printing...
here is my code..
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void ssearch(char a[],char b[]);
main(int argc,char**argv)
i am trying a postfis calculator so far i wrote
#include<stdio.h>
#include<string.h>
int st[15],top=0;
void push(int);
int pop(void);
i want to read a tab delimited file for eg. the format is
item1 value
item2 value
item3 value
item4 value
etc.
i want to store each coloumn in an aaray but i can only do this...
LOL:D it's not mrbrains it's mrbains.
Well did u try to debug it urself
because you missed a lot of ; (semicolons), and few wrong declaration
here's your code in correct form.
I only mean no syntax error rest u have done well , so...
Try writing getchar(); just before starting while loop
Thanks for the knowledge
so i tried to use it and wrote this code for a dynamic size stack kind of thing...
#include<stdio.h>
int *a;
int top=0;
you can take a 2d array and then store lines rowwise in that array.
Hello everyone,
i am studying dynamic memory allocation in c,which can be done by using malloc calloc and realloc.
But still i don't understand the concept.
for eg
int *p;
p=(int*)malloc(100);...
Your question is not clear.
but if, as far i understood,you want to enter values when ever your if statement is true.
for eg.
for(i=0;i<n;i++)
{ if(statement)
{ scanf("%c",a[i]);
I wrote this to find word freq using strstr().
i modified your code hope u don't mind;)
/*Program to find word frequency using strstr()*/
#include<stdio.h>
#include<string.h>
main()
i already did solved the problem using arrays(with a lilttle help from here).
so i guess breaking words using strtok() bad idea??
thank you Adak for the //printing the unique words logic.
Billy...
put a getchar(); before starting the for loop to clear terminating newline ('\n' or ENTER ) from the input stream
But how do i break a string into words using strstr().
the problem is to find freq. of all the words in a string.
As you said i have to use a copy of all words returned by strtok() how can i do...
to find frequency of a word this works
char a[]="mary had a lamb had";
char b[]="had"
char *p=a;
while(p!=NULL)
{
Well i dont really know on what this depends even me i was interested to know your processor because i've seen sizeof(int)=4 on amd.
i am on intel too but my int is 2 bytes.
so may be it depends on...
commontater did u run your code??
because the output is HANG.
is something wrong with my machine??
iam using turbo c++.
will your code work for the first word as u wrote???? search will always be the same.
anyway i've tried using strstr but still as soon as i call strstr(a,pch) it hangs.but if i do strstr(a,b) where...
type this code and run it.
#include<stdio.h>
main()
{
printf("size of int =%i",sizeof(int));
i am using strtok to divide words of string and then calling the function to return frequency.
i know this can be done in other ways but i want to know why my program is not working.
yes i dont...
sizeof(int)=4
sizeof(char)=1
thats why your output is 20 with 5 integers.
Here is a code i wrote to find the word frequency in a string.
#include<stdio.h>
#include<string.h>
int mystr(char *para,char *word)
{int count=0;
if(*word=='\0')
{return 0;