Finding word in a two dimensional array

  • Thread starter Thread starter rambo3131
  • Start date Start date
  • Tags Tags
    Array
AI Thread Summary
In C programming, when searching for a word in a two-dimensional array, it is not necessary to use pointers. Instead, you can utilize array indexes within two nested for loops to access the elements. It's important to use a string comparison function, such as strcmp, for accurate comparisons, rather than using direct equality checks like if(str == "abc"). This approach ensures proper string comparison in C.
rambo3131
Messages
18
Reaction score
0
Hi, I have a question about C.In a two dimensional array ,I will search a word (not a letter).Do i have to use pointers?
 
Technology news on Phys.org
rambo3131 said:
Hi, I have a question about C.In a two dimensional array ,I will search a word (not a letter).Do i have to use pointers?
No, you can use array indexes in two nested for loops. Note that you will need to use a string comparison function (strcmp) rather than a condition like this one:
if(str == "abc")
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top